예제 #1
0
        private void AddConnectionLeaseTimeout(Uri endpoint)
        {
            if (!endpoint.IsAbsoluteUri)
            {
                return;
            }

            var key = new EndpointCacheKey(endpoint);

            lock (_endpoints)
            {
                if (_endpoints.Contains(key))
                {
                    return;
                }

                ServicePointManager.FindServicePoint(endpoint)
                .ConnectionLeaseTimeout = (int)_connectionCloseTimeoutPeriod.TotalMilliseconds;
                _endpoints.Add(key);
            }
        }
예제 #2
0
        // ReSharper disable once MemberCanBeMadeStatic.Local
        // ReSharper disable once UnusedParameter.Local
        private void AddConnectionLeaseTimeout(Uri endpoint)
        {
#if !NETCOREAPP2_1
            if (!endpoint.IsAbsoluteUri)
            {
                return;
            }

            var key = new EndpointCacheKey(endpoint);
            lock (_endpoints)
            {
                if (_endpoints.Contains(key))
                {
                    return;
                }

                ServicePointManager.FindServicePoint(endpoint)
                .ConnectionLeaseTimeout = (int)ConnectionLifeTime.TotalMilliseconds;
                _endpoints.Add(key);
            }
#endif
        }
예제 #3
0
 public bool Equals(EndpointCacheKey other) => _uri == other._uri;
예제 #4
0
 public bool Equals(EndpointCacheKey other) => _hash == other._hash;