Exemplo n.º 1
0
 public Http2StreamContext(
     string connectionId,
     HttpProtocols protocols,
     ServiceContext serviceContext,
     IFeatureCollection connectionFeatures,
     MemoryPool <byte> memoryPool,
     IPEndPoint?localEndPoint,
     IPEndPoint?remoteEndPoint,
     int streamId,
     IHttp2StreamLifetimeHandler streamLifetimeHandler,
     Http2PeerSettings clientPeerSettings,
     Http2PeerSettings serverPeerSettings,
     Http2FrameWriter frameWriter,
     InputFlowControl connectionInputFlowControl,
     OutputFlowControl connectionOutputFlowControl) : base(connectionId, protocols, connectionContext: null !, serviceContext, connectionFeatures, memoryPool, localEndPoint, remoteEndPoint, transport: null !)
Exemplo n.º 2
0
        public static Http2StreamContext CreateHttp2StreamContext(
            string connectionId                   = null,
            ServiceContext serviceContext         = null,
            IFeatureCollection connectionFeatures = null,
            MemoryPool <byte> memoryPool          = null,
            IPEndPoint localEndPoint              = null,
            IPEndPoint remoteEndPoint             = null,
            int?streamId = null,
            IHttp2StreamLifetimeHandler streamLifetimeHandler = null,
            Http2PeerSettings clientPeerSettings          = null,
            Http2PeerSettings serverPeerSettings          = null,
            Http2FrameWriter frameWriter                  = null,
            InputFlowControl connectionInputFlowControl   = null,
            OutputFlowControl connectionOutputFlowControl = null,
            ITimeoutControl timeoutControl                = null)
        {
            var context = new Http2StreamContext
                          (
                connectionId: connectionId ?? "TestConnectionId",
                protocols: HttpProtocols.Http2,
                altSvcHeader: null,
                serviceContext: serviceContext ?? CreateServiceContext(new KestrelServerOptions()),
                connectionFeatures: connectionFeatures ?? new FeatureCollection(),
                memoryPool: memoryPool ?? MemoryPool <byte> .Shared,
                localEndPoint: localEndPoint,
                remoteEndPoint: remoteEndPoint,
                streamId: streamId ?? 0,
                streamLifetimeHandler: streamLifetimeHandler,
                clientPeerSettings: clientPeerSettings ?? new Http2PeerSettings(),
                serverPeerSettings: serverPeerSettings ?? new Http2PeerSettings(),
                frameWriter: frameWriter,
                connectionInputFlowControl: connectionInputFlowControl,
                connectionOutputFlowControl: connectionOutputFlowControl
                          );

            context.TimeoutControl = timeoutControl;

            return(context);
        }