public Connection(IByteConnection c, ISerializer serializer) { this.serializer = serializer; this.ByteConnection = c; this.Received = new MessageQueue<object>(); this.ByteConnection.Received.Subscribe(HandleReceived); ByteConnection.Disconnected += HandleDisconnected; IsAlive = true; }
void HandleDisconnected(IByteConnection c) { FireDisconnected(); }
void HandleConnected(IByteConnection conn) { Connected.FireEventAsync(new Connection(conn, serializer)); }