Ejemplo n.º 1
0
        public Task OnConnectionAsync(MultiplexedConnectionContext connectionContext)
        {
            var memoryPoolFeature = connectionContext.Features.Get <IMemoryPoolFeature>();

            var http3ConnectionContext = new Http3ConnectionContext(
                connectionContext.ConnectionId,
                connectionContext,
                _serviceContext,
                connectionContext.Features,
                memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool <byte> .Shared,
                connectionContext.LocalEndPoint as IPEndPoint,
                connectionContext.RemoteEndPoint as IPEndPoint);

            var connection = new Http3Connection(http3ConnectionContext);

            return(connection.ProcessStreamsAsync(_application));
        }
Ejemplo n.º 2
0
        public Task OnConnectionAsync(MultiplexedConnectionContext connectionContext)
        {
            var memoryPoolFeature = connectionContext.Features.Get <IMemoryPoolFeature>();

            var http3ConnectionContext = new Http3ConnectionContext
            {
                ConnectionId       = connectionContext.ConnectionId,
                ConnectionContext  = connectionContext,
                ServiceContext     = _serviceContext,
                ConnectionFeatures = connectionContext.Features,
                MemoryPool         = memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool <byte> .Shared,
                LocalEndPoint      = connectionContext.LocalEndPoint as IPEndPoint,
                RemoteEndPoint     = connectionContext.RemoteEndPoint as IPEndPoint
            };

            var connection = new Http3Connection(http3ConnectionContext);

            return(connection.ProcessRequestsAsync(_application));
        }