コード例 #1
0
 private static void Cancel(object obj)
 {
     Http2ClientStream clientStream = (Http2ClientStream)obj;
     if (!clientStream.Disposed)
     {
         // Abort locally
         clientStream.Reset(ResetStatusCode.Cancel);
         // Note we send the reset even if we've sent and received a FIN because when the write queue got flushed,
         // we're not sure if our fin actually got sent.
         if (!clientStream.ResetSent)
         {
             RstStreamFrame reset = new RstStreamFrame(clientStream.Id, ResetStatusCode.Cancel);
             clientStream.ResetSent = true;
             clientStream._writeQueue.WriteFrameAsync(reset, Priority.Control);
         }
         clientStream.Dispose();
     }
 }
コード例 #2
0
ファイル: Http2Stream.cs プロジェクト: sgrebnov/http2-katana
        public void WriteRst(ResetStatusCode code)
        {
            var frame = new RstStreamFrame(_id, code);
            _writeQueue.WriteFrame(frame);
            ResetSent = true;

            if (OnFrameSent != null)
            {
                OnFrameSent(this, new FrameSentArgs(frame));
            }
        }