[connect] web-socket connection fixes
This commit is contained in:
@@ -17,4 +17,13 @@ class PacketUtil {
|
||||
packet.writeTo(out);
|
||||
return out.getBytes();
|
||||
}
|
||||
|
||||
public static function toBytesWithSize<P:Message>(packet:P):Bytes {
|
||||
var out = new BytesOutput();
|
||||
out.writeUInt16(0);
|
||||
packet.writeTo(out);
|
||||
var bytes = out.getBytes();
|
||||
bytes.setUInt16(0, bytes.length - 2);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user