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); } }
// 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 }
public bool Equals(EndpointCacheKey other) => _uri == other._uri;
public bool Equals(EndpointCacheKey other) => _hash == other._hash;