2 // ServicePointManager.cs
5 // Rolf Bjarne Kvinge <rolf@xamarin.com>
7 // Copyright (c) 2016 Xamarin, Inc.
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 using System.Net.Security;
31 public partial class ServicePointManager {
32 const string EXCEPTION_MESSAGE = "System.Net.ServicePointManager is not supported on the current platform.";
34 public const int DefaultNonPersistentConnectionLimit = 4;
36 public const int DefaultPersistentConnectionLimit = 10;
38 public const int DefaultPersistentConnectionLimit = 2;
41 private ServicePointManager ()
45 public static ICertificatePolicy CertificatePolicy {
46 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
47 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
50 public static bool CheckCertificateRevocationList {
51 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
52 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
55 public static int DefaultConnectionLimit {
56 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
57 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
60 public static int DnsRefreshTimeout {
61 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
62 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
65 public static bool EnableDnsRoundRobin {
66 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
67 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
70 public static int MaxServicePointIdleTime {
71 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
72 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
75 public static int MaxServicePoints {
76 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
77 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
80 public static bool ReusePort {
81 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
82 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
85 public static SecurityProtocolType SecurityProtocol {
88 } = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
90 public static RemoteCertificateValidationCallback ServerCertificateValidationCallback {
95 public static EncryptionPolicy EncryptionPolicy {
96 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
99 public static bool Expect100Continue {
100 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
101 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
104 public static bool UseNagleAlgorithm {
105 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
106 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
109 public static void SetTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval)
111 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
114 public static ServicePoint FindServicePoint (Uri address)
116 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
119 public static ServicePoint FindServicePoint (string uriString, IWebProxy proxy)
121 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
124 public static ServicePoint FindServicePoint (Uri address, IWebProxy proxy)
126 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);