protected override async Task WhenAsync(CancellationToken cancellation) { _message = (RstStream)(await Control.TryReadAsync( new FrameReader( PipeReader.Create(new MemoryStream(Message))), cancellation) .ConfigureAwait(false)).Result; }
private void Send( RstStream rstStream) { CloseRemote(); CloseLocal(); Send((Frame)rstStream); }
protected override async Task WhenAsync( CancellationToken cancellationToken) { await Server.SendAsync( RstStream.Cancel(_stream.Id), cancellationToken) .ConfigureAwait(false); await _stream.Local.WaitForClosedAsync(cancellationToken) .ConfigureAwait(false); }
private SpdyStream( SynStream synStream, ConcurrentPriorityQueue <Frame> sendingPriorityQueue) { _synStream = synStream; _sendingPriorityQueue = sendingPriorityQueue; _streamInUse = RstStream.StreamInUse(Id); _protocolError = RstStream.ProtocolError(Id); _flowControlError = RstStream.FlowControlError(Id); _streamAlreadyClosedError = RstStream.StreamAlreadyClosed(Id); }
protected override async Task WhenAsync( CancellationToken cancellationToken) { await Server.SendAsync( new WindowUpdate(_stream.Id, UInt31.MaxValue), cancellationToken) .ConfigureAwait(false); _rstStream = await _rstStreamSubscription .ReceiveAsync(CancellationToken) .ConfigureAwait(false); }
protected override async Task WhenAsync( CancellationToken cancellationToken) { await Server.SendAsync( SynReply.Accept(_stream.Id), cancellationToken) .ConfigureAwait(false); _rstStream = await _rstStreamSubscription .ReceiveAsync(CancellationToken) .ConfigureAwait(false); }
protected override async Task WhenAsync( CancellationToken cancellationToken) { var rstSubscription = Server.On <RstStream>(); var windowUpdateSubscription = Server.On <WindowUpdate>(); await Server.SendAsync(Data.Last(_stream.Id, Encoding.UTF8.GetBytes("data")), cancellationToken) .ConfigureAwait(false); _rst = await rstSubscription.ReceiveAsync(cancellationToken) .ConfigureAwait(false); _windowUpdate = await windowUpdateSubscription .ReceiveAsync(cancellationToken) .ConfigureAwait(false); }
public void Dispose() { if (Local.IsOpen) { Send(RstStream.Cancel(Id)); } else { CloseLocal(); } if (Remote.IsOpen) { CloseRemote(); } _frameAvailable.Dispose(); _windowSizeGate.Dispose(); _local.Dispose(); _remote.Dispose(); }
protected override async Task WhenAsync( CancellationToken cancellationToken) { var dataSubscription = Server.On <Data>(); var sendingTask = _stream.SendLastAsync( Encoding.UTF8.GetBytes( "This is more than 5 bytes"), cancellationToken: cancellationToken) .ConfigureAwait(false); _receivedData = await dataSubscription.ReceiveAsync(cancellationToken) .ConfigureAwait(false); var rstSubscription = Server.On <RstStream>(); _stream.Dispose(); _rst = await rstSubscription.ReceiveAsync(cancellationToken) .ConfigureAwait(false); _sendingResult = await sendingTask; }
private ReadResult(RstStream error) { _result = null; _error = error; }
protected override Task GivenAsync(CancellationToken cancellationToken) { _frame = RstStream.Cancel( UInt31.From(123)); return(Task.CompletedTask); }