Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GrpcStream"/> class.
 /// </summary>
 /// <param name="streamWriter">The stream writer.</param>
 /// <param name="streamReader">The stream reader.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="heartbead">The heartbead method.</param>
 public GrpcStream(dynamic streamWriter, IAsyncStreamReader <Command> streamReader, string id)
 {
     this.Id                = id;
     this.StreamWriter      = streamWriter;
     this.StreamReader      = streamReader;
     this.Locked            = false;
     this.streamQueueWorker = new StreamQueueWorker <Command>(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SocketStream" /> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="id">The identifier.</param>
 public SocketStream(TcpClient client, NetworkStream stream, string id)
 {
     this.ClientId                      = id;
     this.MainStream                    = stream;
     this.Client                        = client;
     this.Locked                        = false;
     this.Guard                         = new SocketGuard(this);
     this.streamQueueWorker             = new StreamQueueWorker <WebPackage>(this);
     this.streamQueueWorker.OnException = this.OnException;
 }