示例#1
0
        private void GetNewSegment()
        {
            _currentInputSegment = _incommingSegments.GetResult();
            if (_currentInputSegment == null)
            {
                _readtcs.SetResult(0);
                return;
            }

            _bytesReadInCurrentSegment = 0;
            _currentContentLength      = _currentInputSegment.CurrentContentLength;

            if (_currentContentLength == 0)
            {
                _currentInputSegment.Dispose();
                _currentInputSegment = null;
                _readtcs.SetResult(0);
                return;
            }
            else
            {
                _socket.ReciveInternal();
                CompleteRead();
            }
        }
示例#2
0
 public RioStream(RioConnectionOrientedSocket socket)
 {
     _socket = socket;
     _currentInputSegment      = null;
     _currentOutputSegment     = _socket.SendBufferPool.GetBuffer();
     _getNewSegmentDelegate    = GetNewSegment;
     socket.OnIncommingSegment = s => _incommingSegments.Set(s);
     socket.ReciveInternal();
 }
示例#3
0
 public RioStream(RioConnectionOrientedSocket socket)
 {
     _socket = socket;
     _currentInputSegment = null;
     _currentOutputSegment = _socket.SendBufferPool.GetBuffer();
     _getNewSegmentDelegate = GetNewSegment;
     socket.OnIncommingSegment = s => _incommingSegments.Set(s);
     socket.ReciveInternal();
 }