Пример #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;