feat(connection): packet json logging

This commit is contained in:
2026-05-12 16:41:55 +03:00
parent 8f30eff1dd
commit e8efe9c26d

View File

@@ -7,6 +7,8 @@ import promhx.Deferred;
import promhx.Promise;
import protohx.Message;
using protohx.MessageUtils;
class BaseConnection<O:Message, I:Message> implements IConnection<O, I> {
public var handler(default, null):Signal<ConnectionEvent>;
public var sendHandler(default, null):Signal<O>;
@@ -41,12 +43,12 @@ class BaseConnection<O:Message, I:Message> implements IConnection<O, I> {
}
public function send(packet:O):Void {
#if proto_debug L.d('Proto', 'send: ${packet}'); #end
#if proto_debug L.d('Proto', 'send: ${packet.toJson()}'); #end
sendHandler.emit(packet);
}
public function receive(packet:I):Void {
#if proto_debug L.d('Proto', 'receive: ${packet}'); #end
#if proto_debug L.d('Proto', 'receive: ${packet.toJson()}'); #end
receiveHandler.emit(packet);
}
}