public FrameTestsBase() { App = new FakeApp(); Output = new FakeOutput(); Input = new FakeInput(); Frame = new Frame(App.Call, Output.ProduceData, Output.ProduceEnd); Input.Consume = Frame.Consume; }
private void Go(bool newFrame) { if (newFrame) { _frame = new Frame(_app, ProduceData, ProduceEnd); if (_baton.Buffer.Count != 0) { if (_frame.Consume( _baton, _frameConsumeCallback, _fault)) { return; } } } while (_frame.LocalIntakeFin == false) { SocketError recvError; var buffer = _baton.Available(128); var receiveCount = _socket.Receive( buffer.Array, buffer.Offset, buffer.Count, SocketFlags.None, out recvError); if (recvError == SocketError.WouldBlock) { if (_socket.ReceiveAsync(_socketReceiveAsyncEventArgs)) return; continue; } if (recvError != SocketError.Success || receiveCount == 0) { _baton.RemoteIntakeFin = true; } else { _baton.Extend(receiveCount); } if (_frame.Consume( _baton, _frameConsumeCallback, _fault)) { return; } } }