From 74c86ff4cc8a567a8a1a6b4c20c5f25506f3755e Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 31 May 2017 19:16:38 +0200 Subject: [PATCH] [System] Adds watch specific HttpListenerWebSocketContext --- ...erWebSocketContext.platformnotsupported.cs | 48 +++++++++++++++++++ mcs/class/System/common.sources | 2 - mcs/class/System/common_networking.sources | 2 + .../System/monotouch_watch_System.dll.sources | 1 + 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 mcs/class/System/System.Net.WebSockets/HttpListenerWebSocketContext.platformnotsupported.cs diff --git a/mcs/class/System/System.Net.WebSockets/HttpListenerWebSocketContext.platformnotsupported.cs b/mcs/class/System/System.Net.WebSockets/HttpListenerWebSocketContext.platformnotsupported.cs new file mode 100644 index 00000000000..99fc21b3fec --- /dev/null +++ b/mcs/class/System/System.Net.WebSockets/HttpListenerWebSocketContext.platformnotsupported.cs @@ -0,0 +1,48 @@ +// +// HttpListenerWebSocketContext.platformnotsupported.cs +// +// Author: +// Marek Safar +// +// Copyright (c) 2017 Xamarin Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +namespace System.Net.WebSockets +{ + public partial class HttpListenerWebSocketContext : System.Net.WebSockets.WebSocketContext + { + const string EXCEPTION_MESSAGE = "System.Net.WebSockets.HttpListenerWebSocketContext is not supported on the current platform."; + + private HttpListenerWebSocketContext() { } + public override System.Net.CookieCollection CookieCollection { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override System.Collections.Specialized.NameValueCollection Headers { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override bool IsAuthenticated { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override bool IsLocal { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override bool IsSecureConnection { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override string Origin { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override System.Uri RequestUri { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override string SecWebSocketKey { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override System.Collections.Generic.IEnumerable SecWebSocketProtocols { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override string SecWebSocketVersion { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override System.Security.Principal.IPrincipal User { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + public override System.Net.WebSockets.WebSocket WebSocket { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } + } +} \ No newline at end of file diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index 61e5b6472b9..f20e501c687 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -918,8 +918,6 @@ corefx/SR.cs ../../../external/corefx/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs ../../../external/corefx/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs -../../../external/corefx/src/System.Net.HttpListener/src/System/Net/WebSockets/HttpListenerWebSocketContext.cs - ../../../external/corefx/src/System.Private.Uri/src/System/UriBuilder.cs ../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs diff --git a/mcs/class/System/common_networking.sources b/mcs/class/System/common_networking.sources index 548180b26cb..f161a1657e9 100644 --- a/mcs/class/System/common_networking.sources +++ b/mcs/class/System/common_networking.sources @@ -51,3 +51,5 @@ System.Net/WebConnectionStream.cs ../referencesource/System/net/System/Net/Sockets/TCPClient.cs ../referencesource/System/net/System/Net/Sockets/TCPListener.cs ../referencesource/System/net/System/Net/Sockets/UDPClient.cs + +../../../external/corefx/src/System.Net.HttpListener/src/System/Net/WebSockets/HttpListenerWebSocketContext.cs diff --git a/mcs/class/System/monotouch_watch_System.dll.sources b/mcs/class/System/monotouch_watch_System.dll.sources index ad5e4c7bee8..c639ae74fae 100644 --- a/mcs/class/System/monotouch_watch_System.dll.sources +++ b/mcs/class/System/monotouch_watch_System.dll.sources @@ -19,4 +19,5 @@ System.Net/HttpWebRequest.platformnotsupported.cs System.Net/HttpWebResponse.platformnotsupported.cs System.Net/ServicePoint.platformnotsupported.cs System.Net/ServicePointManager.platformnotsupported.cs +System.Net.WebSockets/HttpListenerWebSocketContext.platformnotsupported.cs ../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs -- 2.25.1