private void ListenSync()
 {
     this._connection = ConnectionFactory.CreateConnection <TRead, TWrite>(this._inStream, this._outStream);
     this._connection.ReceiveMessage += new ConnectionMessageEventHandler <TRead, TWrite>(this.OnReceiveMessage);
     this._connection.Error          += new ConnectionExceptionEventHandler <TRead, TWrite>(this.ConnectionOnError);
     this._connection.Open();
 }
 private void OnReceiveMessage(ObjectStreamConnection <TRead, TWrite> connection, TRead message)
 {
     if (this.Message != null)
     {
         this.Message(connection, message);
     }
 }
 private void ConnectionOnError(ObjectStreamConnection <TRead, TWrite> connection, Exception exception)
 {
     this.OnError(exception);
 }