Example #1
0
 public SegmentStream(BufferSegment segment)
 {
     this._segment   = segment;
     this.m_Position = this._segment.Offset;
 }
Example #2
0
 public Client()
 {
     Sock           = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     _bufferSegment = Buffers.CheckOut();
     Receive();
 }
Example #3
0
 public Client(Socket _sock)
 {
     this.Sock      = _sock;
     _bufferSegment = Buffers.CheckOut();
     Receive();
 }
Example #4
0
 /// <summary>
 /// Copys the data in this segment to another <see cref="BufferSegment" />.
 /// </summary>
 /// <param name="segment">the <see cref="BufferSegment" /> instance to copy to</param>
 /// <param name="length">the amount of bytes to copy from this segment</param>
 /// <exception cref="ArgumentException">an ArgumentException will be thrown if length is greater than
 /// the length of the segment</exception>
 public void CopyTo(BufferSegment segment, int length)
 {
     System.Buffer.BlockCopy(Buffer.Array, Offset, segment.Buffer.Array, segment.Offset, length);
 }