예제 #1
0
 public SegmentStream(BufferSegment segment)
 {
     this._segment   = segment;
     this.m_Position = this._segment.Offset;
 }
예제 #2
0
파일: Client.cs 프로젝트: Skinz3/SSync
 public Client()
 {
     Sock           = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     _bufferSegment = Buffers.CheckOut();
     Receive();
 }
예제 #3
0
파일: Client.cs 프로젝트: Skinz3/SSync
 public Client(Socket _sock)
 {
     this.Sock      = _sock;
     _bufferSegment = Buffers.CheckOut();
     Receive();
 }
예제 #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);
 }