feat(connection): packet json logging
This commit is contained in:
@@ -7,6 +7,8 @@ import promhx.Deferred;
|
|||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
import protohx.Message;
|
import protohx.Message;
|
||||||
|
|
||||||
|
using protohx.MessageUtils;
|
||||||
|
|
||||||
class BaseConnection<O:Message, I:Message> implements IConnection<O, I> {
|
class BaseConnection<O:Message, I:Message> implements IConnection<O, I> {
|
||||||
public var handler(default, null):Signal<ConnectionEvent>;
|
public var handler(default, null):Signal<ConnectionEvent>;
|
||||||
public var sendHandler(default, null):Signal<O>;
|
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 {
|
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);
|
sendHandler.emit(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function receive(packet:I):Void {
|
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);
|
receiveHandler.emit(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user