Пример #1
0
        public Http2Client (Http2ConnectionSettings connectionSettings, IStreamManager streamManager = null, IFlowControlManager flowControlManager = null)
        {            
            this.flowControlManager = flowControlManager ?? new FlowControlManager ();
            this.streamManager = streamManager ?? new StreamManager (this.flowControlManager);
            this.ConnectionSettings = connectionSettings;

            connection = new Http2Connection (ConnectionSettings, this.streamManager, this.flowControlManager);
        }
Пример #2
0
        public Http2Client(Http2ConnectionSettings connectionSettings, IStreamManager streamManager = null, IFlowControlManager flowControlManager = null)
        {
            FlowControlManager = flowControlManager ?? new FlowControlManager();
            StreamManager      = streamManager ?? new StreamManager(this.FlowControlManager);
            ConnectionSettings = connectionSettings;

            connection = new Http2Connection(ConnectionSettings, this.StreamManager, this.FlowControlManager);
        }
Пример #3
0
        public Http2Connection(Http2ConnectionSettings connectionSettings, IStreamManager streamManager, IFlowControlManager flowControlManager)
        {
            this.flowControlManager = flowControlManager;
            this.streamManager      = streamManager;

            ConnectionSettings = connectionSettings;
            Settings           = new Http2Settings();

            queue = new FrameQueue(flowControlManager);
        }
Пример #4
0
        public Http2Connection (Http2ConnectionSettings connectionSettings, IStreamManager streamManager, IFlowControlManager flowControlManager)
        {
            this.flowControlManager = flowControlManager;
            this.streamManager = streamManager;

            ConnectionSettings = connectionSettings;
            Settings = new Http2Settings ();

            queue = new FrameQueue (flowControlManager);
        }
Пример #5
0
        public ApnsHttp2Connection(ApnsHttp2Configuration configuration)
        {
            id = ++ID;
            if (id >= int.MaxValue)
            {
                ID = 0;
            }

            Configuration = configuration;

            certificate = Configuration.Certificate;

            certificates = new X509CertificateCollection();

            // Add local/machine certificate stores to our collection if requested
            if (Configuration.AddLocalAndMachineCertificateStores)
            {
                var store = new X509Store(StoreLocation.LocalMachine);
                certificates.AddRange(store.Certificates);

                store = new X509Store(StoreLocation.CurrentUser);
                certificates.AddRange(store.Certificates);
            }

            // Add optionally specified additional certs into our collection
            if (Configuration.AdditionalCertificates != null)
            {
                foreach (var addlCert in Configuration.AdditionalCertificates)
                {
                    certificates.Add(addlCert);
                }
            }

            // Finally, add the main private cert for authenticating to our collection
            if (certificate != null)
            {
                certificates.Add(certificate);
            }

            var http2Settings = new HttpTwo.Http2ConnectionSettings(
                Configuration.Host,
                (uint)Configuration.Port,
                true,
                certificates);

            http2 = new HttpTwo.Http2Client(http2Settings);
        }
Пример #6
0
 public Http2Client(Http2ConnectionSettings connectionSettings, IStreamManager streamManager = null, IFlowControlManager flowControlManager = null)
 {
     this.flowControlManager = flowControlManager ?? new FlowControlManager();
     this.streamManager      = streamManager ?? new StreamManager(this.flowControlManager);
     this.ConnectionSettings = connectionSettings;
 }