Sfoglia il codice sorgente

[System] Fix a few type members on WatchOS

The .platformnotsupported.cs versions of some classes were
inconsistent with their "real" counterparts.
Alexander Köplinger 9 anni fa
parent
commit
10f86fb5fe

+ 10 - 0
mcs/class/System/System.Net.Sockets/TcpListener.platformnotsupported.cs

@@ -78,6 +78,16 @@ namespace System.Net.Sockets
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
 		}
 
+		public void AllowNatTraversal (bool allowed)
+		{
+			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+		}
+
+		public static TcpListener Create (int port)
+		{
+			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+		}
+
 		~TcpListener ()
 		{
 		}

+ 5 - 0
mcs/class/System/System.Net.Sockets/UdpClient.platformnotsupported.cs

@@ -204,6 +204,11 @@ namespace System.Net.Sockets
 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 		}
 
+		public void AllowNatTraversal (bool allowed)
+		{
+			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+		}
+
 		public void Dispose ()
 		{
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);

+ 24 - 0
mcs/class/System/System.Net/HttpListener.platformnotsupported.cs

@@ -26,6 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Security.Authentication.ExtendedProtection;
 using System.Threading.Tasks;
 
 namespace System.Net {
@@ -33,6 +34,8 @@ namespace System.Net {
 	{
 		internal const string EXCEPTION_MESSAGE = "System.Net.HttpListener is not supported on the current platform.";
 
+		public delegate ExtendedProtectionPolicy ExtendedProtectionSelector (HttpListenerRequest request);
+
 		public HttpListener ()
 		{
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
@@ -75,6 +78,27 @@ namespace System.Net {
 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 		}
 
+		public HttpListenerTimeoutManager TimeoutManager {
+			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+		}
+
+		public ExtendedProtectionPolicy ExtendedProtectionPolicy
+		{
+			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+		}
+
+		public ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
+		{
+			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+		}
+
+		public ServiceNameCollection DefaultServiceNames
+		{
+			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+		}
+
 		public void Abort ()
 		{
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);

+ 5 - 0
mcs/class/System/System.Net/HttpListenerContext.platformnotsupported.cs

@@ -55,6 +55,11 @@ namespace System.Net {
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
 		}
 
+		public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, TimeSpan keepAliveInterval)
+		{
+			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+		}
+
 		public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
 		{
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);

+ 7 - 2
mcs/class/System/System.Net/HttpWebRequest.platformnotsupported.cs

@@ -67,12 +67,12 @@ namespace System.Net
 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 		}
 
-		public bool AllowAutoRedirect {
+		public virtual bool AllowAutoRedirect {
 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 		}
 
-		public bool AllowWriteStreamBuffering {
+		public virtual bool AllowWriteStreamBuffering {
 			get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 			set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
 		}
@@ -360,6 +360,11 @@ namespace System.Net
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
 		}
 
+		public System.IO.Stream GetRequestStream (out TransportContext context)
+		{
+			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+		}
+
 		public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
 		{
 			throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);