示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Connection"/> class.
 /// </summary>
 /// <param name="duplexPipe">The duplex pipe of the (socket) connection.</param>
 /// <param name="decryptionPipe">The decryption pipe.</param>
 /// <param name="encryptionPipe">The encryption pipe.</param>
 public Connection(IDuplexPipe duplexPipe, IPipelinedDecryptor decryptionPipe, IPipelinedEncryptor encryptionPipe)
 {
     this.duplexPipe     = duplexPipe;
     this.encryptionPipe = encryptionPipe;
     this.Source         = decryptionPipe?.Reader ?? this.duplexPipe.Input;
     this.remoteEndPoint = this.SocketConnection?.Socket.RemoteEndPoint;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Connection"/> class.
 /// </summary>
 /// <param name="duplexPipe">The duplex pipe of the (socket) connection.</param>
 /// <param name="decryptionPipe">The decryption pipe.</param>
 /// <param name="encryptionPipe">The encryption pipe.</param>
 public Connection(IDuplexPipe duplexPipe, IPipelinedDecryptor decryptionPipe, IPipelinedEncryptor encryptionPipe)
 {
     this.duplexPipe     = duplexPipe;
     this.decryptionPipe = decryptionPipe;
     this.encryptionPipe = encryptionPipe;
     this.Source         = this.decryptionPipe?.Reader ?? this.duplexPipe.Input;
     this.remoteEndPoint = this.SocketConnection?.Socket.RemoteEndPoint;
     this.Source.OnWriterCompleted((e, state) => this.OnComplete(e), null);
     this.Output.OnReaderCompleted((e, state) => this.OnComplete(e), null);
 }