Beispiel #1
0
        public static void SetPoolInfo(Uri host, int maxConn, int timeout)
        {
            HttpClientPool pool = GetPool(null, host);

            pool.MaxConnections = maxConn;
            pool.TimeOut        = timeout;
        }
Beispiel #2
0
 private static HttpClientPool CreatePool(string key, Uri uri)
 {
     lock (typeof(HttpClientPoolFactory))
     {
         HttpClientPool result;
         if (!mPools.TryGetValue(key, out result))
         {
             bool ssl = uri.Scheme.ToLower() == "https";
             result      = new HttpClientPool(uri.Host, uri.Port, ssl);
             mPools[key] = result;
         }
         return(result);
     }
 }