Exemple #1
0
 /// <summary>
 ///     Creates a new ReadWrapper that wraps the state used to read a message from a stream.
 /// </summary>
 /// <param name="stream">The stream being read.</param>
 public ReadWrapper(NetworkStream stream)
 {
     this.ReadState    = ConnectionReadState.Header;
     this.Buffer       = new byte[BufferSize];
     this.MessageBytes = new List <byte>();
     this.TotalBytes   = 1; // default to header read size.
     this.NextReadSize = this.TotalBytes;
     this.Stream       = stream;
 }
Exemple #2
0
 /// <summary>
 ///     Creates a new ReadWrapper that wraps the state used to read a message from a stream.
 /// </summary>
 /// <param name="stream">The stream being read.</param>
 public ReadWrapper(NetworkStream stream) {
     this.ReadState    = ConnectionReadState.Header;
     this.Buffer       = new byte[BufferSize];
     this.MessageBytes = new List<byte>(); 
     this.TotalBytes   = 1; // default to header read size.
     this.NextReadSize = this.TotalBytes;
     this.Stream       = stream;
 }