예제 #1
0
 /// <exception cref="System.IO.IOException"></exception>
 public virtual void RouteComplete(HttpClientConnection managedConn, HttpRoute route
                                   , HttpContext context)
 {
     Args.NotNull(managedConn, "Managed Connection");
     Args.NotNull(route, "HTTP route");
     lock (managedConn)
     {
         CPoolEntry entry = CPoolProxy.GetPoolEntry(managedConn);
         entry.MarkRouteComplete();
     }
 }
예제 #2
0
        /// <exception cref="System.IO.IOException"></exception>
        public virtual void Upgrade(HttpClientConnection managedConn, HttpRoute route, HttpContext
                                    context)
        {
            Args.NotNull(managedConn, "Managed Connection");
            Args.NotNull(route, "HTTP route");
            ManagedHttpClientConnection conn;

            lock (managedConn)
            {
                CPoolEntry entry = CPoolProxy.GetPoolEntry(managedConn);
                conn = entry.GetConnection();
            }
            this.connectionOperator.Upgrade(conn, route.GetTargetHost(), context);
        }
예제 #3
0
        /// <exception cref="System.IO.IOException"></exception>
        public virtual void Connect(HttpClientConnection managedConn, HttpRoute route, int
                                    connectTimeout, HttpContext context)
        {
            Args.NotNull(managedConn, "Managed Connection");
            Args.NotNull(route, "HTTP route");
            ManagedHttpClientConnection conn;

            lock (managedConn)
            {
                CPoolEntry entry = CPoolProxy.GetPoolEntry(managedConn);
                conn = entry.GetConnection();
            }
            HttpHost host;

            if (route.GetProxyHost() != null)
            {
                host = route.GetProxyHost();
            }
            else
            {
                host = route.GetTargetHost();
            }
            IPEndPoint   localAddress = route.GetLocalSocketAddress();
            SocketConfig socketConfig = this.configData.GetSocketConfig(host);

            if (socketConfig == null)
            {
                socketConfig = this.configData.GetDefaultSocketConfig();
            }
            if (socketConfig == null)
            {
                socketConfig = SocketConfig.Default;
            }
            this.connectionOperator.Connect(conn, host, localAddress, connectTimeout, socketConfig
                                            , context);
        }