Permalink
Browse files

Removing writeLength (should take place in RPC instead)

  • Loading branch information...
MattTuttle committed Mar 19, 2015
1 parent 64b2c01 commit 9201cec18620206b532d7a5e559800cb316c9bf6
Showing with 4 additions and 4 deletions.
  1. +1 −1 hxnet/interfaces/Connection.hx
  2. +3 −3 hxnet/tcp/Connection.hx
@@ -5,6 +5,6 @@ import haxe.io.Bytes;
interface Connection
{
public function isOpen():Bool;
public function writeBytes(bytes:Bytes, writeLength:Bool=false):Bool;
public function writeBytes(bytes:Bytes):Bool;
public function close():Void;
}
View
@@ -20,18 +20,18 @@ class Connection implements hxnet.interfaces.Connection
return socket != null;
}
public function writeBytes(bytes:Bytes, writeLength:Bool=false):Bool
public function writeBytes(bytes:Bytes):Bool
{
try
{
#if flash
if (writeLength) socket.writeInt(bytes.length);
// if (writeLength) socket.writeInt(bytes.length);
for (i in 0...bytes.length)
{
socket.writeByte(bytes.get(i));
}
#else
if (writeLength) socket.output.writeInt32(bytes.length);
// if (writeLength) socket.output.writeInt32(bytes.length);
socket.output.writeBytes(bytes, 0, bytes.length);
#end
}

0 comments on commit 9201cec

Please sign in to comment.