[common] binary message in ws connection
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package ru.m.connect.neko;
|
||||
|
||||
import haxe.io.BytesOutput;
|
||||
import protohx.Message;
|
||||
import sys.net.Socket;
|
||||
|
||||
@@ -19,9 +18,7 @@ class NekoConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||
|
||||
private function _send(packet:O):Void {
|
||||
try {
|
||||
var b = new BytesOutput();
|
||||
packet.writeTo(b);
|
||||
var bytes = b.getBytes();
|
||||
var bytes = PacketUtil.toBytes(packet);
|
||||
socket.output.writeUInt16(bytes.length);
|
||||
socket.output.write(bytes);
|
||||
socket.output.flush();
|
||||
|
||||
Reference in New Issue
Block a user