1 //
2 // ServicePoint.cs
3 //
4 // Author:
5 //       Rolf Bjarne Kvinge <rolf@xamarin.com>
6 //
7 // Copyright (c) 2016 Xamarin, Inc.
8 //
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:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
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
25 // THE SOFTWARE.
26 
27 using System.Net.Sockets;
28 using System.Security.Cryptography.X509Certificates;
29 
30 namespace System.Net
31 {
32 	public class ServicePoint
33 	{
34 		const string EXCEPTION_MESSAGE = "System.Net.ServicePoint is not supported on the current platform.";
35 
ServicePoint()36 		ServicePoint () {}
37 
38 		public Uri Address {
39 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
40 		}
41 
GetMustImplement()42 		static Exception GetMustImplement ()
43 		{
44 			return new NotImplementedException ();
45 		}
46 
47 		public BindIPEndPoint BindIPEndPointDelegate
48 		{
49 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
50 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
51 		}
52 
53 		public int ConnectionLeaseTimeout {
54 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
55 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
56 		}
57 
58 		public int ConnectionLimit {
59 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
60 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
61 		}
62 
63 		public string ConnectionName {
64 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
65 		}
66 
67 		public int CurrentConnections {
68 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
69 		}
70 
71 		public DateTime IdleSince {
72 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
73 		}
74 
75 		public int MaxIdleTime {
76 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
77 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
78 		}
79 
80 		public virtual Version ProtocolVersion {
81 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
82 		}
83 
84 		public int ReceiveBufferSize {
85 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
86 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
87 		}
88 
89 		public bool SupportsPipelining {
90 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
91 		}
92 
93 		public bool Expect100Continue {
94 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
95 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
96 		}
97 
98 		public bool UseNagleAlgorithm {
99 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
100 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
101 		}
102 
SetTcpKeepAlive(bool enabled, int keepAliveTime, int keepAliveInterval)103 		public void SetTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval)
104 		{
105 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
106 		}
107 
CloseConnectionGroup(string connectionGroupName)108 		public bool CloseConnectionGroup (string connectionGroupName)
109 		{
110 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
111 		}
112 
113 		public  X509Certificate Certificate {
114 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
115 		}
116 
117 		public  X509Certificate ClientCertificate {
118 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
119 		}
120 
121 		// For reference source
GetConnection(PooledStream PooledStream, object owner, bool async, out IPAddress address, ref Socket abortSocket, ref Socket abortSocket6)122 		internal Socket GetConnection(PooledStream PooledStream, object owner, bool async, out IPAddress address, ref Socket abortSocket, ref Socket abortSocket6)
123 		{
124 			throw new NotImplementedException ();
125 		}
126 	}
127 }
128