コード例 #1
0
ファイル: RestClient.cs プロジェクト: Ignis34Rus/bgTeam.Core
        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
ファイル: RestClient.cs プロジェクト: Ignis34Rus/bgTeam.Core
 public bool Equals(EndpointCacheKey other) => _hash == other._hash;