public Http3ControlStream(Http3StreamContext context) { var httpLimits = context.ServiceContext.ServerOptions.Limits; _context = context; _serverPeerSettings = context.ServerPeerSettings; _streamIdFeature = context.ConnectionFeatures.GetRequiredFeature <IStreamIdFeature>(); _errorCodeFeature = context.ConnectionFeatures.GetRequiredFeature <IProtocolErrorCodeFeature>(); _headerType = -1; _frameWriter = new Http3FrameWriter( context.StreamContext, context.TimeoutControl, httpLimits.MinResponseDataRate, context.MemoryPool, context.ServiceContext.Log, _streamIdFeature, context.ClientPeerSettings, this); _frameWriter.Reset(context.Transport.Output, context.ConnectionId); }
private Http3StreamContext CreateHttpStreamContext(ConnectionContext streamContext) { var httpConnectionContext = new Http3StreamContext( _multiplexedContext.ConnectionId, HttpProtocols.Http3, _context.AltSvcHeader, _multiplexedContext, _context.ServiceContext, streamContext.Features, _context.MemoryPool, streamContext.LocalEndPoint as IPEndPoint, streamContext.RemoteEndPoint as IPEndPoint, _streamLifetimeHandler, streamContext, _clientSettings, _serverSettings); httpConnectionContext.TimeoutControl = _context.TimeoutControl; httpConnectionContext.Transport = streamContext.Transport; return(httpConnectionContext); }
public Http3ControlStream(IHttpApplication <TContext> application, Http3StreamContext context) : base(context) { _application = application; }
public Http3Stream(IHttpApplication <TContext> application, Http3StreamContext context) { Initialize(context); _application = application; }
public TestHttp3Stream(Http3Connection connection, Http3StreamContext context) : base(connection, context) { }
public TestHttp3Stream(Http3StreamContext context) : base(context) { }
public async ValueTask <long> ReadNextStreamHeaderAsync(Http3StreamContext context, long streamId, Http3StreamType?advanceOn) { var Input = context.Transport.Input; var advance = false; SequencePosition consumed = default; SequencePosition start = default; try { while (!_isClosed) { var result = await Input.ReadAsync(); if (result.IsCanceled) { throw new Exception(); } var readableBuffer = result.Buffer; consumed = readableBuffer.Start; start = readableBuffer.Start; if (!readableBuffer.IsEmpty) { var value = VariableLengthIntegerHelper.GetInteger(readableBuffer, out consumed, out _); if (value != -1) { if (!advanceOn.HasValue || value == (long)advanceOn) { advance = true; } return(value); } } if (result.IsCompleted) { return(-1L); } } } catch (Exception) { throw new Http3PendingStreamException(CoreStrings.AttemptedToReadHeaderOnAbortedStream, streamId, _abortedException); } finally { if (!_isClosed) { if (advance) { Input.AdvanceTo(consumed); } else { Input.AdvanceTo(start); } } StreamTimeoutTicks = default; } return(-1L); }
public Http3PendingStream(Http3StreamContext context, long id) { Context = context; StreamTimeoutTicks = default; StreamId = id; }
public Http3ControlStream(IHttpApplication <TContext> application, Http3StreamContext context, long?headerType) : base(context, headerType) { _application = application; }