public void PrepareRstStream(int streamId, Proto2ErrorCode errorCode)
 {
     PayloadLength      = 4;
     Type               = Proto2FrameType.RST_STREAM;
     Flags              = 0;
     StreamId           = streamId;
     RstStreamErrorCode = errorCode;
 }
Beispiel #2
0
 public void PrepareGoAway(int lastStreamId, Proto2ErrorCode errorCode)
 {
     PayloadLength      = 8;
     Type               = Proto2FrameType.GOAWAY;
     Flags              = 0;
     StreamId           = 0;
     GoAwayLastStreamId = lastStreamId;
     GoAwayErrorCode    = errorCode;
 }
Beispiel #3
0
        internal void ResetAndAbort(ConnectionAbortedException abortReason, Proto2ErrorCode error)
        {
            // Future incoming frames will drain for a default grace period to avoid destabilizing the connection.
            var states = ApplyCompletionFlag(StreamCompletionFlags.Aborted);

            if (states.OldState == states.NewState)
            {
                return;
            }

            Log.Proto2StreamResetAbort(TraceIdentifier, error, abortReason);

            // Don't block on IO. This never faults.
            _ = _http2Output.WriteRstStreamAsync(error);

            AbortCore(abortReason);
        }
Beispiel #4
0
 public void Proto2StreamResetAbort(string traceIdentifier, Proto2ErrorCode error, ConnectionAbortedException abortReason)
 {
     _http2StreamResetError(_logger, traceIdentifier, error, abortReason);
 }
Beispiel #5
0
 public Proto2StreamErrorException(int streamId, string message, Proto2ErrorCode errorCode)
     : base($"HTTP/2 stream ID {streamId} error ({errorCode}): {message}")
 {
     StreamId  = streamId;
     ErrorCode = errorCode;
 }
 public Proto2ConnectionErrorException(string message, Proto2ErrorCode errorCode)
     : base($"HTTP/2 connection error ({errorCode}): {message}")
 {
     ErrorCode = errorCode;
 }