feat(connection): packet json logging
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user