Merge pull request #3626 from lateralusX/jlorenss/win-api-family-support-eglib
authorJohan Lorensson <lateralusx.github@gmail.com>
Wed, 28 Sep 2016 06:40:30 +0000 (08:40 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2016 06:40:30 +0000 (08:40 +0200)
Build eglib under none desktop Windows API family.

195 files changed:
README.md
appveyor.yml [deleted file]
mcs/build/common/basic-profile-check.cs
mcs/build/profiles/monotouch_watch.make
mcs/build/profiles/monotouch_watch_runtime.make
mcs/class/Facades/subdirs.make
mcs/class/Makefile
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
mcs/class/Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
mcs/class/System.ComponentModel.Composition.4.5/Makefile
mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs
mcs/class/System.Core/System.IO.Pipes/PipeUnix.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientHandlerTest.cs
mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources [new file with mode: 0644]
mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/ReferenceSources/SchemaExporter_mobile.cs
mcs/class/System.Runtime.Serialization/ReferenceSources/XsdDataContractExporter_mobile.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources
mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs
mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs
mcs/class/System.XML/System.Xml.Serialization/XmlSerializerFactory.cs
mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs
mcs/class/System/Microsoft.Win32.SafeHandles/SafeX509ChainHandle.cs
mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
mcs/class/System/Mono.Net.Security/LegacySslStream.cs
mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs
mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs
mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs
mcs/class/System/ReferenceSources/Logging.cs
mcs/class/System/ReferenceSources/Socket.cs
mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs [deleted file]
mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs [deleted file]
mcs/class/System/System.IO/FileSystemWatcher_mobile.cs
mcs/class/System/System.Net.Mail/MailMessage.cs
mcs/class/System/System.Net.Mail/SmtpClient.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net.NetworkInformation/Ping.cs
mcs/class/System/System.Net.Security/NegotiateStream.cs
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs
mcs/class/System/System.Net.Sockets/TcpClient.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/TcpListener.cs
mcs/class/System/System.Net.Sockets/TcpListener.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/UdpClient.cs
mcs/class/System/System.Net.Sockets/UdpClient.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net.WebSockets/ClientWebSocket.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/AuthenticationManager.cs
mcs/class/System/System.Net/Dns.cs
mcs/class/System/System.Net/FtpRequestCreator.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/FtpWebRequest.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/FtpWebResponse.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListener.cs
mcs/class/System/System.Net/HttpListener.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerContext.cs
mcs/class/System/System.Net/HttpListenerContext.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerPrefixCollection.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerRequest.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerResponse.cs
mcs/class/System/System.Net/HttpListenerResponse.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerResponseHelper.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerTimeoutManager.cs
mcs/class/System/System.Net/HttpWebRequest.cs
mcs/class/System/System.Net/HttpWebRequest.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpWebResponse.cs
mcs/class/System/System.Net/HttpWebResponse.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/ServicePointManager.cs
mcs/class/System/System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs [deleted file]
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
mcs/class/System/System.dll.sources
mcs/class/System/Test/System.Net.Mail/SmtpClientTest.cs
mcs/class/System/Test/System.Net.Security/SslStreamTest.cs
mcs/class/System/Test/System.Net.Sockets/NetworkStreamTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketAcceptAsyncTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketAsyncTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs
mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs
mcs/class/System/Test/System.Net/CookieParserTest.cs
mcs/class/System/Test/System.Net/DnsTest.cs
mcs/class/System/Test/System.Net/FileWebRequestTest.cs
mcs/class/System/Test/System.Net/FtpWebRequestTest.cs
mcs/class/System/Test/System.Net/HttpListener2Test.cs
mcs/class/System/Test/System.Net/HttpListenerPrefixCollectionTest.cs
mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs
mcs/class/System/Test/System.Net/HttpListenerTest.cs
mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
mcs/class/System/Test/System.Net/HttpWebResponseTest.cs
mcs/class/System/Test/System.Net/ServicePointTest.cs
mcs/class/System/Test/System.Net/WebClientTest.cs
mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
mcs/class/System/Test/System.Net/WebRequestTest.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/System/monotouch_watch_System.dll.exclude.sources [new file with mode: 0644]
mcs/class/System/monotouch_watch_System.dll.sources
mcs/class/corlib/Documentation/s [deleted file]
mcs/class/corlib/Mono/Runtime.cs
mcs/class/corlib/ReferenceSources/String.cs
mcs/class/corlib/System.Diagnostics.Tracing/EventSourceException.cs [deleted file]
mcs/class/corlib/System.IO/File.cs
mcs/class/corlib/System.IO/FileStream.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System.Reflection/Assembly.cs
mcs/class/corlib/System.Reflection/TargetException.cs [deleted file]
mcs/class/corlib/System.Reflection/TargetInvocationException.cs [deleted file]
mcs/class/corlib/System.Reflection/TargetParameterCountException.cs [deleted file]
mcs/class/corlib/System.Runtime/GCLatencyMode.cs
mcs/class/corlib/System.Security.AccessControl/EventWaitHandleSecurity.cs
mcs/class/corlib/System.Security.AccessControl/NativeObjectSecurity.cs
mcs/class/corlib/System.Security.AccessControl/ObjectSecurity_T.cs
mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/System/TypeSpec.cs
mcs/class/corlib/Test/System.Reflection.Emit/ModuleBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs
mcs/class/corlib/Test/System/AttributeTest.cs
mcs/class/corlib/corlib.dll.sources
mcs/class/corlib/net_4_x_corlib.dll.sources [deleted file]
mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs
mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs
mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs
mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlSerializableServices.cs
mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
mcs/class/referencesource/System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
mcs/class/referencesource/mscorlib/system/contextboundobject.cs
mcs/class/referencesource/mscorlib/system/io/fileinfo.cs
mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs
mcs/class/referencesource/mscorlib/system/io/stream.cs
mcs/class/referencesource/mscorlib/system/io/textreader.cs
mcs/class/referencesource/mscorlib/system/io/textwriter.cs
mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs
mcs/class/referencesource/mscorlib/system/security/attributes.cs
mcs/class/referencesource/mscorlib/system/threading/threadabortexception.cs
mcs/ilasm/parser/ILParser.jay
mcs/tests/test-16628-lib.il [new file with mode: 0644]
mcs/tools/corcompare/mono-api-info.cs
mcs/tools/xbuild/tests/Vbc/1.vbproj [new file with mode: 0644]
mcs/tools/xbuild/tests/Vbc/2.vbproj [new file with mode: 0644]
mcs/tools/xbuild/tests/Vbc/test.vb [new file with mode: 0644]
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/handle.c
mono/metadata/handle.h
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/loader.c
mono/metadata/marshal.c
mono/metadata/metadata.c
mono/metadata/null-gc.c
mono/metadata/object-internals.h
mono/metadata/sgen-mono.c
mono/metadata/socket-io.c
mono/metadata/sre.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/driver.c
mono/mini/ir-emit.h
mono/mini/method-to-ir.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini-trampolines.c
mono/sgen/sgen-internal.c
mono/sgen/sgen-marksweep-drain-gray-stack.h
mono/utils/Makefile.am
mono/utils/mono-log-android.c [new file with mode: 0644]
mono/utils/mono-log-darwin.c [new file with mode: 0644]
mono/utils/mono-logger-internals.h
mono/utils/mono-logger.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h

index 2b583e599be14ae9ab3139c7a11d55e7a1ab574a..15e32dd886d074e63d6f8bb44d2871c34083325e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,19 +15,22 @@ The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.or
 6. [Configuration Options](#configuration-options)
 7. [Working with Submodules](#working-with-submodules)
 
-**Build Status**
-
-Officially supported architectures:
-
-| ubuntu-1404-amd64            | ubuntu-1404-i386            | debian-8-armel            | debian-8-armhf            | debian-8-arm64              | windows-amd64              |
-|------------------------------|-----------------------------|---------------------------|---------------------------|-----------------------------|----------------------------|
-| [![ubuntu-1404-amd64][1]][2] | [![ubuntu-1404-i386][3]][4] | [![debian-8-armel][5]][6] | [![debian-8-armhf][7]][8] | [![debian-8-arm64][9]][10]  | [![windows-amd64][11]][12] |
-
-Community supported architectures:
-
-| centos-s390x              |
-|---------------------------|
-| [![centos-s390x][13]][14] |
+### Build Status
+
+| OS           | Architecture       | Status                       |
+|--------------|--------------------|------------------------------|
+| Ubuntu 14.04 | amd64              | [![ubuntu-1404-amd64][1]][2] |
+| Ubuntu 14.04 | i386               | [![ubuntu-1404-i386][3]][4]  |
+| Debian 8     | armel              | [![debian-8-armel][5]][6]    |
+| Debian 8     | armhf              | [![debian-8-armhf][7]][8]    |
+| Debian 8     | arm64              | [![debian-8-arm64][9]][10]   |
+| OS X         | amd64              | [![osx-amd64][11]][12]       |
+| OS X         | i386               | [![osx-i386][13]][14]        |
+| Windows      | amd64              | [![windows-amd64][15]][16]   |
+| Windows      | i386               | [![windows-amd64][17]][18]   |
+| CentOS       | s390x (cs)         | [![centos-s390x][19]][20]    |
+
+_(cs) = community supported architecture_
 
 [1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
 [2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
@@ -39,10 +42,16 @@ Community supported architectures:
 [8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
 [9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
 [10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
-[11]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
-[12]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
-[13]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
-[14]: https://jenkins.mono-project.com/job/z/label=centos-s390x
+[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
+[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
+[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
+[14]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/
+[15]: https://jenkins.mono-project.com/job/z/label=w64/badge/icon
+[16]: https://jenkins.mono-project.com/job/z/label=w64/
+[17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
+[18]: https://jenkins.mono-project.com/job/z/label=w32/
+[19]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
+[20]: https://jenkins.mono-project.com/job/z/label=centos-s390x
 
 Compilation and Installation
 ============================
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644 (file)
index 8fa713a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
-#
-# For further details see http://www.appveyor.com
-#
-
-#
-# Custom environment variables
-#
-environment:
-    global:
-        CYG_ROOT: C:\cygwin
-        CYG_MIRROR: http://cygwin.mirror.constant.com
-        CYG_CACHE: C:\cygwin\var\cache\setup
-        CYG_BASH: C:\cygwin\bin\bash
-
-#
-# Cache Cygwin files to speed up build
-#
-cache:
-    - '%CYG_CACHE%'
-
-#
-# Do a shallow clone of the repo to speed up build
-#
-clone_depth: 1
-
-#
-# Initialisation prior to pulling the Mono repository
-# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
-#
-init:
-    - git config --global core.autocrlf input
-
-#
-# Install needed build dependencies
-# 
-install:
-    - ps: 'Start-FileDownload "http://cygwin.com/setup-x86.exe" -FileName "setup-x86.exe"'
-    - 'setup-x86.exe --quiet-mode --no-shortcuts --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages autoconf,automake,bison,gcc-core,gcc-g++,mingw-runtime,mingw-binutils,mingw-gcc-core,mingw-gcc-g++,mingw-pthreads,mingw-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,libxslt > NUL 2>&1'
-    - '%CYG_BASH% -lc "cygcheck -dc cygwin"'
-
-# Cygwin build script
-#
-# NOTES:
-#
-# The stdin/stdout file descriptor appears not to be valid for the Appveyor
-# build which causes failures as certain functions attempt to redirect 
-# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
-#
-build_script:
-    - 'echo Building...'
-    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./autogen.sh --prefix=/usr/local --host=i686-pc-mingw32"'
-    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
-    - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make -j2"'
-    - 'echo Installing...'
-    - 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
-    - '%CYG_BASH% -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
-
-#
-# Disable tests for now
-# 
-test: off
-
-#
-# Only build the master branch
-#
-branches:
-  only:
-    - master
-
-#
-# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
-#       It has to be relative to the project path. Thus we have installed to within the build tree.
-#
-artifacts:
-    - path: install
-      name: mono-binaries
-      type: zip
index b9e02f62b26855d207fe6bde66f9900f43b44d19..631b764bf9dd24608afc325f7d47d345ea34edee 100644 (file)
@@ -40,7 +40,7 @@ class X {
                if (!Version.TryParse (field.GetValue (null) as string, out version))
                        return 4;
 
-               if (version < new Version (3, 8))
+               if (version < new Version (4, 0))
                        return 5;
 
                return 0;
index 0242c20bf515ca05121382763c7a25f3d1d9e86d..02c934b62e6ae89fb558f05a9bd942c4ecbfcc99 100644 (file)
@@ -1,6 +1,7 @@
 include $(topdir)/build/profiles/monotouch.make
 
 PROFILE_MCS_FLAGS += \
+       -d:FEATURE_NO_BSD_SOCKETS \
        -d:MONOTOUCH_WATCH
 
 NO_THREAD_ABORT=1
index 7b3eb80a551dc7325b9cfde0edc5728899696bf2..cb6bf304b99fdfe255e5cc5ac78e0c8703090751 100644 (file)
@@ -1,6 +1,7 @@
 include $(topdir)/build/profiles/monotouch_runtime.make
 
 PROFILE_MCS_FLAGS += \
+       -d:FEATURE_NO_BSD_SOCKETS \
        -d:MONOTOUCH_WATCH
 
 NO_THREAD_ABORT=1
index 7c6c5d092f1d91b07ff931bff7d8b335c1838cd7..99e5ef51402044e78d1dc6c7032885e6e7edb1bf 100644 (file)
@@ -43,6 +43,12 @@ mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
 net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) $(drawing_DEPS_SUBDIRS)
 net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS)
 
+build_PARALLEL_SUBDIRS = System.Runtime System.Reflection System.Collections System.Resources.ResourceManager System.Globalization \
+System.Threading.Tasks System.Collections.Concurrent System.Text.Encoding System.IO System.Threading System.Diagnostics.Debug \
+System.Linq.Expressions System.Dynamic.Runtime System.Linq System.Threading.Tasks.Parallel System.Xml.ReaderWriter \
+System.Diagnostics.Tools System.Reflection.Primitives System.Runtime.Extensions System.Runtime.InteropServices System.Text.Encoding.Extensions \
+System.Runtime.Numerics System.Xml.XDocument System.Reflection.Extensions
+
 monodroid_SUBDIRS = $(monotouch_SUBDIRS)
 monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
 
index e170ff9c9964324fb67db81714d6468c3a330bec..db4f42754010cc669dda38e99777c5710108d5b0 100644 (file)
@@ -1,6 +1,8 @@
 thisdir = class
 
-basic_SUBDIRS := corlib Mono.Security System System.XML System.Core 
+basic_SUBDIRS := corlib Mono.Security System System.XML System.Core
+
+pcl_facade_dirs := Facades
 
 # resgen is corlib specific so we need to wait until corlib is build
 # and build it just a step before first dll needs it
@@ -14,9 +16,11 @@ build_SUBDIRS :=  \
        Mono.Posix \
        System.Core \
        Mono.Cecil \
-       Mono.Cecil.Mdb
-
-pcl_facade_dirs := Facades
+       Mono.Cecil.Mdb \
+       System.ComponentModel.Composition.4.5 \
+       System.Numerics \
+       System.Xml.Linq \
+       $(pcl_facade_dirs)
 
 mobile_common_dirs := \
        corlib  \
@@ -347,20 +351,33 @@ all-local $(STD_TARGETS:=-local):
 all-local-aot:
 
 # Files needed to bootstrap C# compiler
-basic_files = basic.exe mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll
-monolite_files = $(basic_files:%=lib/monolite/%)
+build_files = mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll \
+       System.Numerics.dll System.Xml.Linq.dll \
+       Facades/System.Collections.Concurrent.dll Facades/System.Linq.dll Facades/System.Runtime.dll Facades/System.Collections.dll     \
+       Facades/System.Reflection.Extensions.dll Facades/System.Text.Encoding.Extensions.dll Facades/System.Diagnostics.Debug.dll \
+       Facades/System.Reflection.Primitives.dll Facades/System.Text.Encoding.dll Facades/System.Diagnostics.Tools.dll Facades/System.Reflection.dll \
+       Facades/System.Threading.Tasks.Parallel.dll Facades/System.Dynamic.Runtime.dll Facades/System.Resources.ResourceManager.dll \
+       Facades/System.Threading.Tasks.dll Facades/System.Globalization.dll Facades/System.Runtime.Extensions.dll Facades/System.Threading.dll \
+       Facades/System.IO.dll Facades/System.Runtime.InteropServices.dll Facades/System.Xml.ReaderWriter.dll Facades/System.Linq.Expressions.dll \
+       Facades/System.Runtime.Numerics.dll Facades/System.Xml.XDocument.dll
+
+monolite_files = $(build_files:%=lib/monolite/%)
 
 lib/monolite:
+lib/monolite/Facades:
        $(MKINSTALLDIRS) $@
 
 $(monolite_files): | lib/monolite
-$(monolite_files): lib/monolite/%: lib/basic/%
+$(monolite_files): | lib/monolite/Facades
+$(monolite_files): lib/monolite/%: lib/build/%
        cp -p $< $@
 
-$(basic_files:%=lib/basic/%):
-       cd $(topdir) && $(MAKE) profile-do--basic--all NO_DIR_CHECK=1 SKIP_AOT=1
+$(build_files:%=lib/build/%):
+       cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
 
 dist-default: $(monolite_files)
+       cp -p lib/basic/basic.exe lib/monolite
+
 dist-local: dist-default
 
 csproj-local:
index cf56b148f117e2427363568d8a2be911ea64e807..ae6d75bf406fd3dfe9260b5a16feb4c4d3ead083 100644 (file)
@@ -153,7 +153,10 @@ namespace Microsoft.Build.Tasks {
                {
                        if (!string.IsNullOrEmpty (ToolPath))
                                return Path.Combine (ToolPath, ToolExe);
-                       return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+                       var possibleToolPath = ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+                       if (!string.IsNullOrEmpty(possibleToolPath))
+                               return  possibleToolPath;
+                       return ToolLocationHelper.GetPathToDotNetFrameworkBinFile(ToolExe); 
                }
                
                [MonoTODO]
index fd392b409e5a4bef6de68f174911b79f638997be..594580b86d7d350e9d24daa2c2aaa9a32ec2af1a 100644 (file)
@@ -148,17 +148,23 @@ namespace Mono.Security.Interface
                /*
                 * Internal API, intended to be used by MonoTlsProvider implementations.
                 */
+               internal static ICertificateValidator2 GetInternalValidator (MonoTlsSettings settings, MonoTlsProvider provider)
+               {
+                       return (ICertificateValidator2)NoReflectionHelper.GetInternalValidator (provider, settings);
+               }
+
+               [Obsolete ("Use GetInternalValidator")]
                internal static ICertificateValidator2 GetDefaultValidator (MonoTlsSettings settings, MonoTlsProvider provider)
                {
-                       return (ICertificateValidator2)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
+                       return GetInternalValidator (settings, provider);
                }
 
                /*
                 * Use this overloaded version in user code.
                 */
-               public static ICertificateValidator GetValidator (MonoTlsSettings settings, MonoTlsProvider provider = null)
+               public static ICertificateValidator GetValidator (MonoTlsSettings settings)
                {
-                       return GetDefaultValidator (settings, provider);
+                       return (ICertificateValidator)NoReflectionHelper.GetDefaultValidator (settings);
                }
        }
 }
index 66980df81a6ab254278b5c6a057681128fa431ba..1060677c59401a0666c75cac1cc844348f3a60be 100644 (file)
@@ -31,6 +31,7 @@ namespace Mono.Security.Interface
        /// <summary>
        /// RFC 2246 A.5
        /// </summary>
+       [CLSCompliant (false)]
        public enum CipherSuiteCode : ushort
        {
                TLS_NULL_WITH_NULL_NULL = 0x0000,
index 63003e366b9db64eae270edd87fba522a81fe5e3..120d885eaf07985e921eae567a3ef56bfa63177a 100644 (file)
@@ -29,6 +29,7 @@ namespace Mono.Security.Interface
 {
        public class MonoTlsConnectionInfo
        {
+               [CLSCompliant (false)]
                public CipherSuiteCode CipherSuiteCode {
                        get; set;
                }
index 557d024da21f8495e0dfdc804c3f030f641c13af..a9983f129077b3e9e21bb19f3a533bdda60df04e 100644 (file)
@@ -39,7 +39,37 @@ namespace Mono.Security.Interface
        public static partial class MonoTlsProviderFactory
        {
                /*
-                * Returns the currently installed @MonoTlsProvider, falling back to the default one.
+                * TLS Provider Initialization
+                * ===========================
+                * 
+                * The "global" TLS Provider (returned by GetProvider()) may only be modified at
+                * application startup (before any of the TLS / Certificate code has been used).
+                * 
+                * On mobile, the default provider is specified at compile time using a property
+                * in the .csproj file (which can be set from the IDE).  When using the linker, all
+                * other providers will be linked-out, so you won't be able to choose a different
+                * provider at run-time.
+                * 
+                * On desktop, the default provider can be specified with the MONO_TLS_PROVIDER
+                * environment variable.  The following options are currently supported:
+                * 
+                *    "default" - let Mono pick the best one for you (recommended)
+                *    "old" or "legacy" - Mono's old managed TLS implementation
+                *    "appletls" (currently XamMac only, set via .csproj property)
+                *    "btls" - the new boringssl based provider (coming soon).
+                * 
+                * On all platforms (except mobile with linker), you can call
+                * 
+                *     MonoTlsProviderFactory.Initialize(string)
+                * 
+                * to use a different provider.
+                * 
+                */
+
+               #region Provider Initialization
+
+               /*
+                * Returns the global @MonoTlsProvider, initializing the TLS Subsystem if necessary.
                 *
                 * This method throws @NotSupportedException if no TLS Provider can be found.
                 */
@@ -49,42 +79,64 @@ namespace Mono.Security.Interface
                }
 
                /*
-                * Returns the default @MonoTlsProvider.
-                *
-                * This method throws @NotSupportedException if no TLS Provider can be found.
+                * Check whether the TLS Subsystem is initialized.
                 */
-               public static MonoTlsProvider GetDefaultProvider ()
+               public static bool IsInitialized {
+                       get {
+                               return NoReflectionHelper.IsInitialized;
+                       }
+               }
+
+               /*
+                * Initialize the TLS Subsystem.
+                * 
+                * This method may be called at any time.  It ensures that the TLS Subsystem is
+                * initialized and a provider available.
+                */
+               public static void Initialize ()
                {
-                       return (MonoTlsProvider)NoReflectionHelper.GetDefaultProvider ();
+                       NoReflectionHelper.Initialize ();
                }
 
                /*
-                * GetProvider() attempts to load and install the default provider and throws on error.
-                *
-                * This property checks whether a provider has previously been installed by a call
-                * to either GetProvider() or InstallProvider().
-                *
+                * Initialize the TLS Subsystem with a specific provider.
+                * 
+                * May only be called at application startup (before any of the TLS / Certificate
+                * APIs have been used).
+                * 
+                * Throws @NotSupportedException if the TLS Subsystem is already initialized
+                * (@IsInitialized returns true) or the requested provider is not supported.
+                * 
+                * On mobile, this will always throw @NotSupportedException when using the linker.
                 */
-               public static bool HasProvider {
-                       get {
-                               return NoReflectionHelper.HasProvider;
-                       }
+               public static void Initialize (string provider)
+               {
+                       NoReflectionHelper.Initialize (provider);
                }
 
                /*
-                * Selects the default TLS Provider.
+                * Checks whether @provider is supported.
                 *
-                * May only be called at application startup and will throw
-                * @InvalidOperationException if a provider has already been installed.
+                * On mobile, this will always return false when using the linker.
                 */
-               public static void SetDefaultProvider (string name)
+               public static bool IsProviderSupported (string provider)
                {
-                       NoReflectionHelper.SetDefaultProvider (name);
+                       return NoReflectionHelper.IsProviderSupported (provider);
                }
 
-               public static MonoTlsProvider GetProvider (string name)
+               #endregion
+
+               #region Call-by-call selection
+
+               /*
+                * Returns the requested TLS Provider, for use with the call-by-call APIs below.
+                * 
+                * Throw @NotSupportedException if the requested provider is not supported or
+                * when using the linker on mobile.
+                */
+               public static MonoTlsProvider GetProvider (string provider)
                {
-                       return (MonoTlsProvider)NoReflectionHelper.GetProvider (name);
+                       return (MonoTlsProvider)NoReflectionHelper.GetProvider (provider);
                }
 
                /*
@@ -108,6 +160,24 @@ namespace Mono.Security.Interface
                {
                        return (IMonoSslStream)NoReflectionHelper.GetMonoSslStream (stream);
                }
+
+               #endregion
+
+               #region Obsolete APIs
+
+               [Obsolete]
+               public static MonoTlsProvider GetDefaultProvider ()
+               {
+                       return GetProvider ();
+               }
+
+               [Obsolete]
+               public static void SetDefaultProvider (string name)
+               {
+                       Initialize (name);
+               }
+
+               #endregion
        }
 }
 
index 24b28a790efd6398311b34e526a8b9fb395bce0c..7721bb00a51d6add53e50ce177ef3dacbdcf8803 100644 (file)
@@ -82,6 +82,7 @@ namespace Mono.Security.Interface
                        get; set;
                }
 
+               [CLSCompliant (false)]
                public CipherSuiteCode[] EnabledCiphers {
                        get; set;
                }
index 9c35c71ec5627798b735f29e46db1c9224af615b..6c6a5b5d52a5dcb1f7ee606f3a8aa309da4e9ea9 100644 (file)
@@ -5,7 +5,11 @@ include ../../build/rules.make
 LIBRARY = System.ComponentModel.Composition.dll
 LIB_REFS = System System.Core
 
-RESOURCE_DEFS = Microsoft.Internal.Strings,src/ComponentModel/Strings.resx
+NO_RESGEN := $(filter basic build, $(PROFILE))
+ifndef NO_RESGEN
+  RESOURCE_DEFS = Microsoft.Internal.Strings,src/ComponentModel/Strings.resx
+endif
+
 LIB_MCS_FLAGS = -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414
 
 
index 873ce5782aa4d48a2f32f86ee01e91746d8b9f9e..cbf1491612fcb12ef9a378c26e6cf214b0d30835 100644 (file)
@@ -30,10 +30,10 @@ using System;
 
 namespace Microsoft.Win32.SafeHandles
 {
-       public abstract class SafeNCryptHandle : System.Runtime.InteropServices.SafeHandle
+       public abstract class SafeNCryptHandle : SafeHandleZeroOrMinusOneIsInvalid
        {
                protected SafeNCryptHandle ()
-                       : base (IntPtr.Zero, true)
+                       : base (true)
                {
                }
 
index 18bfca4934c79d7c257bd8a1f4f0451049da4e7b..fbc55fd73b5e62c356363f97aeb51b14fe2dbdc8 100644 (file)
@@ -111,9 +111,9 @@ namespace System.IO.MemoryMappedFiles
 
 
        public class MemoryMappedFile : IDisposable {
-               MemoryMappedFileAccess fileAccess;
-               string name;
-               long fileCapacity;
+               // MemoryMappedFileAccess fileAccess;
+               // string name;
+               // long fileCapacity;
 
                //
                // We allow the use of either the FileStream/keepOpen combo
@@ -144,8 +144,8 @@ namespace System.IO.MemoryMappedFiles
 
                        return new MemoryMappedFile () {
                                handle = handle,
-                               fileAccess = MemoryMappedFileAccess.ReadWrite,
-                               fileCapacity = capacity
+                               // fileAccess = MemoryMappedFileAccess.ReadWrite,
+                               // fileCapacity = capacity
                        };
                }
 
@@ -176,9 +176,9 @@ namespace System.IO.MemoryMappedFiles
                        
                        return new MemoryMappedFile () {
                                handle = handle,
-                               fileAccess = access,
-                               name = mapName,
-                               fileCapacity = capacity
+                               // fileAccess = access,
+                               // name = mapName,
+                               // fileCapacity = capacity
                        };
                }
 
@@ -193,15 +193,15 @@ namespace System.IO.MemoryMappedFiles
                        if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
                                throw new ArgumentException ("capacity");
 
-                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.Handle, mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
                        
                        MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
                                
                        return new MemoryMappedFile () {
                                handle = handle,
-                               fileAccess = access,
-                               name = mapName,
-                               fileCapacity = capacity,
+                               // fileAccess = access,
+                               // name = mapName,
+                               // fileCapacity = capacity,
 
                                stream = fileStream,
                                keepOpen = leaveOpen
@@ -220,15 +220,15 @@ namespace System.IO.MemoryMappedFiles
                        if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
                                throw new ArgumentException ("capacity");
 
-                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.Handle, mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
                        
                        MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
                                
                        return new MemoryMappedFile () {
                                handle = handle,
-                               fileAccess = access,
-                               name = mapName,
-                               fileCapacity = capacity,
+                               // fileAccess = access,
+                               // name = mapName,
+                               // fileCapacity = capacity,
 
                                stream = fileStream,
                                keepOpen = leaveOpen
@@ -249,9 +249,9 @@ namespace System.IO.MemoryMappedFiles
                        
                        return new MemoryMappedFile () {
                                handle = handle,
-                               fileAccess = access,
-                               name = mapName,
-                               fileCapacity = capacity
+                               // fileAccess = access,
+                               // name = mapName,
+                               // fileCapacity = capacity
                        };                      
                }
 
index 2f06df8949a4e2d2efc15a07fd8d581f7be49880..a1c7e22d8c49a07fe5b4e6ac31482a3a8a887449 100644 (file)
@@ -205,7 +205,7 @@ namespace System.IO.Pipes
                        opener = delegate {
                                var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (desiredAccessRights), FileShare.ReadWrite);
                                owner.Stream = fs;
-                               handle = new SafePipeHandle (fs.Handle, false);
+                               handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
                        };
                }
 
@@ -271,7 +271,7 @@ namespace System.IO.Pipes
                        // FIXME: maxNumberOfServerInstances, modes, sizes, handle inheritability
                        
                        var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (rights), FileShare.ReadWrite);
-                       handle = new SafePipeHandle (fs.Handle, false);
+                       handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
                        owner.Stream = fs;
                        should_close_handle = true;
                }
diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..eb5b7ff
--- /dev/null
@@ -0,0 +1,175 @@
+//
+// System.Net.Http/HttpClientHandler.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Collections.Generic;
+using System.Net.Security;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace System.Net.Http
+{
+       public class HttpClientHandler : HttpMessageHandler
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Http.HttpClientHandler is not supported on the current platform.";
+
+               public HttpClientHandler ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public bool AllowAutoRedirect {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DecompressionMethods AutomaticDecompression {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ClientCertificateOption ClientCertificateOptions {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public CookieContainer CookieContainer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ICredentials Credentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaxAutomaticRedirections {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public long MaxRequestContentBufferSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool PreAuthenticate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IWebProxy Proxy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool SupportsAutomaticDecompression {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool SupportsProxy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool SupportsRedirectConfiguration {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseCookies {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseDefaultCredentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseProxy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               HttpResponseMessage CreateResponseMessage (HttpWebResponse wr, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected internal async override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+#if NETSTANDARD
+               public bool CheckCertificateRevocationList {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public X509CertificateCollection ClientCertificates {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ICredentials DefaultProxyCredentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaxConnectionsPerServer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaxResponseHeadersLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IDictionary<string,object> Properties {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Func<HttpRequestMessage,X509Certificate2,X509Chain,SslPolicyErrors,bool> ServerCertificateCustomValidationCallback {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SslProtocols SslProtocols {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+#endif
+       }
+}
index 78f8a0c225d5eb089658e94aa3aa821bc1706f42..3f06e1c316da8440c0a8701439deb9e5ee18b770 100644 (file)
@@ -61,6 +61,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Properties_Defaults ()
                {
                        var h = new HttpClientHandler ();
@@ -83,6 +86,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Properties_Invalid ()
                {
                        var h = new HttpClientHandler ();
@@ -107,6 +113,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Properties_AfterClientCreation ()
                {
                        var h = new HttpClientHandler ();
@@ -119,6 +128,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Disposed ()
                {
                        var h = new HttpClientHandler ();
index f1af864e214943a61321e2cf20cf93ff4a215cc7..d9aab417dfa00762ff0848ae78385316ada5a7e3 100644 (file)
@@ -263,6 +263,10 @@ namespace MonoTests.System.Net.Http
 
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               // Using HttpClientHandler, which indirectly requires BSD sockets.
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CancelRequestViaProxy ()
                {
                        var handler = new HttpClientHandler {
@@ -321,7 +325,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Proxy_Disabled ()
                {
                        var pp = WebRequest.DefaultWebProxy;
@@ -398,7 +404,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Default ()
                {
                        bool? failed = null;
@@ -443,7 +451,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Version_1_0 ()
                {
                        bool? failed = null;
@@ -491,7 +501,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_ClientHandlerSettings ()
                {
                        bool? failed = null;
@@ -556,7 +568,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_CustomHeaders ()
                {
                        bool? failed = null;
@@ -621,7 +635,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_CustomHeaders_SpecialSeparators ()
                {
                        bool? failed = null;
@@ -656,7 +672,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_CustomHeaders_Host ()
                {
                        bool? failed = null;
@@ -690,7 +708,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Transfer_Encoding_Chunked ()
                {
                        bool? failed = null;
@@ -720,7 +740,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Transfer_Encoding_Custom ()
                {
                        bool? failed = null;
@@ -749,7 +771,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Content ()
                {
                        var listener = CreateListener (l => {
@@ -777,7 +801,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Content_MaxResponseContentBufferSize ()
                {
                        var listener = CreateListener (l => {
@@ -800,7 +826,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Content_MaxResponseContentBufferSize_Error ()
                {
                        var listener = CreateListener (l => {
@@ -827,7 +855,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_NoContent ()
                {
                        foreach (var method in new HttpMethod[] { HttpMethod.Post, HttpMethod.Put, HttpMethod.Delete }) {
@@ -860,7 +890,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Complete_Error ()
                {
                        var listener = CreateListener (l => {
@@ -881,7 +913,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Content_Get ()
                {
                        var listener = CreateListener (l => {
@@ -901,7 +935,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Content_BomEncoding ()
                {
                        var listener = CreateListener (l => {
@@ -926,7 +962,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Content_Put ()
                {
                        bool passed = false;
@@ -952,7 +990,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Content_Put_CustomStream ()
                {
                        bool passed = false;
@@ -1055,7 +1095,9 @@ namespace MonoTests.System.Net.Http
 
                [Test]
                [Category ("MobileNotWorking")] // Missing encoding
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetString_Many ()
                {
                        Action<HttpListenerContext> context = (HttpListenerContext l) => {
@@ -1085,7 +1127,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetByteArray_ServerError ()
                {
                        var listener = CreateListener (l => {
@@ -1108,7 +1152,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DisallowAutoRedirect ()
                {
                        var listener = CreateListener (l => {
@@ -1137,7 +1183,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void RequestUriAfterRedirect ()
                {
                        var listener = CreateListener (l => {
@@ -1178,7 +1226,9 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                /*
                 * Properties may only be modified before sending the first request.
                 */
@@ -1209,6 +1259,10 @@ namespace MonoTests.System.Net.Http
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               // Using HttpClientHandler, which indirectly requires BSD sockets.
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                /*
                 * However, this policy is not enforced for custom handlers and there
                 * is also no way a derived class could tell its HttpClientHandler parent
diff --git a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources
new file mode 100644 (file)
index 0000000..5c2ff8a
--- /dev/null
@@ -0,0 +1 @@
+System.Net.Http/HttpClientHandler.cs
diff --git a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources
new file mode 100644 (file)
index 0000000..a9d766e
--- /dev/null
@@ -0,0 +1,2 @@
+#include System.Net.Http.dll.sources
+System.Net.Http/HttpClientHandler.platformnotsupported.cs
index 74ed3335acb89306584341d1642cb1371a64b870..19da4ee2235bf1c77971ebe32cb77cf6e94aa002 100644 (file)
@@ -55,6 +55,11 @@ namespace System.Runtime.Serialization
             return false;
         }
 
+        internal static void AddDefaultXmlType(XmlSchemaSet schemas, string localName, string ns)
+        {
+            throw new NotImplementedException();
+        }
+
         static bool InvokeSchemaProviderMethod(Type clrType, XmlSchemaSet schemas, out XmlQualifiedName stableName, out XmlSchemaType xsdType, out bool hasRoot)
         {
             xsdType = null;
diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/XsdDataContractExporter_mobile.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/XsdDataContractExporter_mobile.cs
new file mode 100644 (file)
index 0000000..bc1bf43
--- /dev/null
@@ -0,0 +1,54 @@
+//
+// XsdDataContractExporter_mobile.cs
+//
+// Authors:
+//     Alexander Köplinger <alexander.koeplinger@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace System.Runtime.Serialization
+{
+       public class XsdDataContractExporter
+       {
+               public XsdDataContractExporter () { throw new NotImplementedException (); }
+               public XsdDataContractExporter (XmlSchemaSet schemas) { throw new NotImplementedException (); }
+               public ExportOptions Options { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
+               public XmlSchemaSet Schemas { get { throw new NotImplementedException (); } }
+               public bool CanExport (ICollection<Assembly> assemblies) { throw new NotImplementedException ();}
+               public bool CanExport (ICollection<Type> types) { throw new NotImplementedException (); }
+               public bool CanExport (Type type) { throw new NotImplementedException (); }
+               public void Export (ICollection<Assembly> assemblies) { throw new NotImplementedException (); }
+               public void Export (ICollection<Type> types) { throw new NotImplementedException (); }
+               public void Export (Type type) { throw new NotImplementedException (); }
+               public XmlQualifiedName GetRootElementName (Type type) { throw new NotImplementedException (); }
+               public XmlSchemaType GetSchemaType (Type type) { throw new NotImplementedException (); }
+               public XmlQualifiedName GetSchemaTypeName (Type type) { throw new NotImplementedException (); }
+       }
+}
+
index c0c73b07ad060fd22023aa3448912020fa0071df..bc4259a994c55a6d42e1e290835bd9f7dd7ebfac 100644 (file)
@@ -2,4 +2,5 @@
 #include ReferenceSource.common.sources
 
 ReferenceSources/SchemaExporter_mobile.cs
+ReferenceSources/XsdDataContractExporter_mobile.cs
 ReferenceSources/SimplifiedCodeTypeReference.cs
index 3e087ef5ac6bb9ecad20206ee909ee8c405743e3..72034979fdb48590c5b9a550f2624f15e2b2e4cb 100644 (file)
@@ -2138,7 +2138,7 @@ namespace System.Windows.Forms
                static bool AreEqual (VisualStyleElement value1, VisualStyleElement value2)
                {
                        return
-                               value1.ClassName == value1.ClassName &&
+                               value1.ClassName == value2.ClassName &&
                                value1.Part == value2.Part &&
                                value1.State == value2.State;
                }
index 32593bc4e016164b22b2f5942fc4db6aa3f09afd..de6710af0a5f3fd9b95fecbe7b12e41c486311c3 100644 (file)
@@ -729,6 +729,29 @@ namespace System.Xml.Serialization
                        return serializable;
                }
 
+               protected IXmlSerializable ReadSerializable (IXmlSerializable serializable, bool wrappedAny)
+               {
+                       string name = null;
+                       string ns = null;
+
+                       if (wrappedAny) {
+                               name = reader.LocalName;
+                               ns = reader.NamespaceURI;
+                               reader.Read ();
+                               reader.MoveToContent ();
+                       }
+                       serializable.ReadXml (reader);
+
+                       if (wrappedAny) {
+                               while (reader.NodeType == XmlNodeType.Whitespace) reader.Skip ();
+                               if (reader.NodeType == XmlNodeType.None) reader.Skip ();
+                               if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == name && reader.NamespaceURI == ns) {
+                                       reader.Read ();
+                               }
+                       }
+                       return serializable;
+               }
+
                protected string ReadString (string value)
                {
                        readCount++;
index 0805d7f61a6d71d000a41ddb1474e7200e67ec11..60bbc316699e378070fa9628ddd884b9e818f2da 100644 (file)
@@ -204,6 +204,11 @@ namespace System.Xml.Serialization
                {
                }
 
+               public XmlSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location)
+                       : this (type, overrides, extraTypes, root, defaultNamespace, location, null)
+               {
+               }
+
                public XmlSerializer (Type type, XmlAttributeOverrides overrides)
                        : this (type, overrides, null, null, null)
                {
index 204b67f71c943000e00b32deb54bf72ea6c037fb..02c86fd7e62febdee00ab74f114d16e88a322304 100644 (file)
@@ -61,6 +61,11 @@ namespace System.Xml.Serialization
                        }
                }
 
+               public XmlSerializer CreateSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location)
+               {
+                       return CreateSerializer (type, overrides, extraTypes, root, defaultNamespace, location, null);
+               }
+
                public XmlSerializer CreateSerializer (Type type, string defaultNamespace)
                {
                        return CreateSerializer (type, null, null, null, defaultNamespace);
index 94dcc0285baf146428ccc8cb596d6777d8f015de..e2b3432b0ae877efc26dc6ec8dd503af3ed33856 100644 (file)
@@ -32,6 +32,7 @@ using System.CodeDom.Compiler;
 using System.Collections;
 using System.IO;
 using System.Text;
+using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Security;
 using System.Security.Policy;
@@ -136,6 +137,11 @@ namespace System.Xml.Xsl
                        Transform (input.CreateNavigator (), arguments, results, null);
                }
 
+               public void Transform (IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
+               {
+                       Transform (input.CreateNavigator (), arguments, results, documentResolver);
+               }
+
                public void Transform (XmlReader input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
                {
                        Transform (new XPathDocument (input, XmlSpace.Preserve).CreateNavigator (), arguments, results, documentResolver);
@@ -203,6 +209,15 @@ namespace System.Xml.Xsl
                        Load (new XPathDocument (stylesheetUri, XmlSpace.Preserve).CreateNavigator (), settings, stylesheetResolver);
                }
 
+               public void Load (MethodInfo executeMethod, byte[] queryData, Type[] earlyBoundTypes)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public void Load (Type compiledStylesheet)
+               {
+                       throw new NotImplementedException ();
+               }
                #endregion
        }
 
index f3091aa38bc1de43829a03ffeb0b886659949df0..9bad4ea25dd9ae03b4f64426bdfec98f006228fa 100644 (file)
@@ -34,25 +34,16 @@ using System.Security;
 
 namespace Microsoft.Win32.SafeHandles
 {
-       public sealed class SafeX509ChainHandle : SafeHandle
+       public sealed class SafeX509ChainHandle : SafeHandleZeroOrMinusOneIsInvalid
        {
-               [MonoTODO]
-               public override bool IsInvalid
-               {
-                       get
-                       {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               [MonoTODO]
-               internal SafeX509ChainHandle() : base ((IntPtr)0, false)
+               internal SafeX509ChainHandle (IntPtr handle)
+                       : base (true)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               protected override bool ReleaseHandle()
+               protected override bool ReleaseHandle ()
                {
                        throw new NotImplementedException ();
                }
index 7827d97600b108629470fa47c64858aabfae5d79..5f90ffe2b82241f4390b9c112c0c36c0e0abaeb9 100644 (file)
@@ -99,7 +99,8 @@ namespace Mono.Net.Security
                Complete,
                WantRead,
                WantWrite,
-               ReadDone
+               ReadDone,
+               FinishWrite
        }
 
        class AsyncProtocolRequest
@@ -160,9 +161,16 @@ namespace Mono.Net.Security
                        Debug ("ResetRead: {0} {1}", oldStatus, Status);
                }
 
+               internal void ResetWrite ()
+               {
+                       var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
+                       Debug ("ResetWrite: {0} {1}", oldStatus, Status);
+               }
+
                internal void RequestWrite ()
                {
                        var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
+                       Debug ("RequestWrite: {0} {1}", oldStatus, Status);
                        if (oldStatus == AsyncOperationStatus.Running)
                                return;
                        else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
@@ -209,7 +217,19 @@ namespace Mono.Net.Security
 
                                status = ProcessOperation (status);
 
-                               var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
+                               Debug ("ProcessOperation done: {0}", status);
+
+                               AsyncOperationStatus oldStatus;
+                               if (status == AsyncOperationStatus.Complete) {
+                                       oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
+                                       if (oldStatus == AsyncOperationStatus.WantWrite) {
+                                               // We are done, but still need to flush the write queue.
+                                               status = AsyncOperationStatus.FinishWrite;
+                                               continue;
+                                       }
+                               }
+
+                               oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
                                Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
 
                                if (oldStatus != AsyncOperationStatus.Running) {
@@ -243,7 +263,9 @@ namespace Mono.Net.Security
                                else
                                        return AsyncOperationStatus.WantRead;
                        } else if (status == AsyncOperationStatus.WantWrite) {
+                               Debug ("ProcessOperation - want write");
                                Parent.InnerWrite ();
+                               Debug ("ProcessOperation - want write done");
                                return AsyncOperationStatus.Continue;
                        } else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
                                Debug ("ProcessOperation - continue");
@@ -255,6 +277,11 @@ namespace Mono.Net.Security
                                status = Operation (this, status);
                                Debug ("ProcessOperation - read done: {0}", status);
                                return status;
+                       } else if (status == AsyncOperationStatus.FinishWrite) {
+                               Debug ("ProcessOperation - finish write");
+                               Parent.InnerWrite ();
+                               Debug ("ProcessOperation - finish write done");
+                               return AsyncOperationStatus.Complete;
                        }
 
                        throw new InvalidOperationException ();
index 5d2812d2738e4c51c72af55564a3e3c95356e0c4..3f14f95bea696faa323bd543c567215a6ba27832 100644 (file)
@@ -77,7 +77,7 @@ namespace Mono.Net.Security
                readonly MonoTlsStream tlsStream;
                readonly HttpWebRequest request;
 
-               internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+               internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
                        if (settings == null)
                                return new ChainValidationHelper (provider, null, false, null, null);
@@ -86,6 +86,16 @@ namespace Mono.Net.Security
                        return new ChainValidationHelper (provider, settings, false, null, null);
                }
 
+               internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+               {
+                       var provider = MonoTlsProviderFactory.GetProvider ();
+                       if (settings == null)
+                               return new ChainValidationHelper (provider, null, false, null, null);
+                       if (settings.CertificateValidator != null)
+                               throw new NotSupportedException ();
+                       return new ChainValidationHelper (provider, settings, false, null, null);
+               }
+
 #region SslStream support
 
                /*
@@ -138,6 +148,8 @@ namespace Mono.Net.Security
                                settings = MonoTlsSettings.CopyDefaultSettings ();
                        if (cloneSettings)
                                settings = settings.CloneWithValidator (this);
+                       if (provider == null)
+                               provider = MonoTlsProviderFactory.GetProvider ();
 
                        this.provider = provider;
                        this.settings = settings;
index 1a6672f6c5c36f634b575715a611d14148e86c0a..7ec9a86813977d98ddcf63b3d85b52cfdf69deb2 100644 (file)
@@ -91,7 +91,7 @@ namespace Mono.Net.Security.Private
                        : base (innerStream, leaveInnerStreamOpen)
                {
                        this.provider = provider;
-                       certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
+                       certificateValidator = ChainValidationHelper.GetInternalValidator (provider, settings);
                }
                #endregion // Constructors
 
index 8701ffe92e691624893f3f2643f2d22635bae41a..cf1082618e625432d5df952fbbe10d769f8591b5 100644 (file)
@@ -660,6 +660,7 @@ namespace Mono.Net.Security
                        if (wantMore || writeBuffer.Size > 0)
                                return AsyncOperationStatus.WantWrite;
 
+                       asyncRequest.ResetWrite ();
                        asyncRequest.UserResult = asyncRequest.CurrentSize;
                        return AsyncOperationStatus.Complete;
                }
index 677a5107697810aca010c8c16aff84d06ba8229d..752f0c49efb26f9a8855fd7d29a25f1dab583fcc 100644 (file)
@@ -54,7 +54,7 @@ namespace Mono.Net.Security
                        this.clientCertificates = clientCertificates;
                        this.askForClientCert = askForClientCert;
 
-                       certificateValidator = CertificateValidationHelper.GetDefaultValidator (
+                       certificateValidator = CertificateValidationHelper.GetInternalValidator (
                                parent.Settings, parent.Provider);
                }
 
index 3dc005344f3b50baf23a65d02938a18c479b4fa3..742a7286ab693311e7e9fafe8549febb466c84ba 100644 (file)
@@ -64,56 +64,54 @@ namespace Mono.Net.Security
 
                internal static IMonoTlsProvider GetProviderInternal ()
                {
+                       #if SECURITY_DEP
                        lock (locker) {
-                               if (currentProvider != null)
-                                       return currentProvider;
-
-                               try {
-                                       defaultProvider = GetDefaultProviderInternal ();
-                               } catch (Exception ex) {
-                                       throw new NotSupportedException ("TLS Support not available.", ex);
-                               }
-
-                               if (defaultProvider == null)
-                                       throw new NotSupportedException ("TLS Support not available.");
-
-                               currentProvider = defaultProvider;
-                               return currentProvider;
+                               InitializeInternal ();
+                               return defaultProvider;
                        }
+                       #else
+                       throw new NotSupportedException ("TLS Support not available.");
+                       #endif
                }
 
-               internal static IMonoTlsProvider GetDefaultProviderInternal ()
+#if SECURITY_DEP
+               internal static void InitializeInternal ()
                {
                        lock (locker) {
-                               if (defaultProvider != null)
-                                       return defaultProvider;
+                               if (initialized)
+                                       return;
 
+                               MSI.MonoTlsProvider provider;
                                try {
-                                       defaultProvider = CreateDefaultProvider ();
+                                       provider = CreateDefaultProviderImpl ();
                                } catch (Exception ex) {
                                        throw new NotSupportedException ("TLS Support not available.", ex);
                                }
 
-                               if (defaultProvider == null)
+                               if (provider == null)
                                        throw new NotSupportedException ("TLS Support not available.");
 
-                               return defaultProvider;
+                               defaultProvider = new Private.MonoTlsProviderWrapper (provider);
+                               initialized = true;
                        }
                }
 
-               static IMonoTlsProvider CreateDefaultProvider ()
+               internal static void InitializeInternal (string provider) 
                {
-#if SECURITY_DEP
-                       MSI.MonoTlsProvider provider = CreateDefaultProviderImpl ();
-                       if (provider != null)
-                               return new Private.MonoTlsProviderWrapper (provider);
-#endif
-                       return null;
+                       lock (locker) {
+                               if (initialized)
+                                       throw new NotSupportedException ("TLS Subsystem already initialized.");
+
+                               var msiProvider = LookupProvider (provider, true);
+                               defaultProvider = new Private.MonoTlsProviderWrapper (msiProvider);
+                               initialized = true;
+                       }
                }
+#endif
 
                static object locker = new object ();
+               static bool initialized;
                static IMonoTlsProvider defaultProvider;
-               static IMonoTlsProvider currentProvider;
 
                #endregion
 
@@ -206,13 +204,9 @@ namespace Mono.Net.Security
                        return provider.Provider;
                }
 
-               internal static MSI.MonoTlsProvider GetDefaultProvider ()
+               internal static bool IsProviderSupported (string name)
                {
-                       var provider = GetDefaultProviderInternal ();
-                       if (provider == null)
-                               throw new NotSupportedException ("No TLS Provider available.");
-
-                       return provider.Provider;
+                       return LookupProvider (name, false) != null;
                }
 
                internal static MSI.MonoTlsProvider GetProvider (string name)
@@ -220,20 +214,30 @@ namespace Mono.Net.Security
                        return LookupProvider (name, false);
                }
 
-               internal static bool HasProvider {
+               internal static bool IsInitialized {
                        get {
                                lock (locker) {
-                                       return currentProvider != null;
+                                       return initialized;
                                }
                        }
                }
 
-               internal static void SetDefaultProvider (string name)
+               internal static void Initialize ()
                {
-                       lock (locker) {
-                               var provider = LookupProvider (name, true);
-                               currentProvider = new Private.MonoTlsProviderWrapper (provider);
-                       }
+                       #if SECURITY_DEP
+                       InitializeInternal ();
+                       #else
+                       throw new NotSupportedException ("TLS Support not available.");
+                       #endif
+               }
+
+               internal static void Initialize (string provider)
+               {
+                       #if SECURITY_DEP
+                       InitializeInternal (provider);
+                       #else
+                       throw new NotSupportedException ("TLS Support not available.");
+                       #endif
                }
 
                internal static HttpWebRequest CreateHttpsRequest (Uri requestUri, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
index 6de1cd2599345f6e857e342f6cb88f008ce8bdf8..2787775d30204014f088f82f644ced144f584b02 100644 (file)
@@ -47,47 +47,56 @@ namespace Mono.Net.Security
        //
        internal static class NoReflectionHelper
        {
-               internal static object GetDefaultCertificateValidator (object provider, object settings)
+               internal static object GetInternalValidator (object provider, object settings)
                {
                        #if SECURITY_DEP
-                       return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       return ChainValidationHelper.GetInternalValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
                        #else
                        throw new NotSupportedException ();
                        #endif
                }
 
-               internal static object GetProvider ()
+               internal static object GetDefaultValidator (object settings)
                {
                        #if SECURITY_DEP
-                       return MonoTlsProviderFactory.GetProvider ();
+                       return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsSettings)settings);
                        #else
                        throw new NotSupportedException ();
                        #endif
                }
 
-               internal static object GetDefaultProvider ()
+               internal static object GetProvider ()
                {
                        #if SECURITY_DEP
-                       return MonoTlsProviderFactory.GetDefaultProvider ();
+                       return MonoTlsProviderFactory.GetProvider ();
                        #else
                        throw new NotSupportedException ();
                        #endif
                }
 
-               internal static bool HasProvider {
+               internal static bool IsInitialized {
                        get {
                                #if SECURITY_DEP
-                               return MonoTlsProviderFactory.HasProvider;
+                               return MonoTlsProviderFactory.IsInitialized;
                                #else
                                throw new NotSupportedException ();
                                #endif
                        }
                }
 
-               internal static void SetDefaultProvider (string name)
+               internal static void Initialize ()
+               {
+                       #if SECURITY_DEP
+                       MonoTlsProviderFactory.Initialize ();
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static void Initialize (string provider)
                {
                        #if SECURITY_DEP
-                       MonoTlsProviderFactory.SetDefaultProvider (name);
+                       MonoTlsProviderFactory.Initialize (provider);
                        #else
                        throw new NotSupportedException ();
                        #endif
@@ -120,6 +129,15 @@ namespace Mono.Net.Security
                        #endif
                }
 
+               internal static bool IsProviderSupported (string name)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.IsProviderSupported (name);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
                internal static object GetProvider (string name)
                {
                        #if SECURITY_DEP
index b5b773e28c4f186888e9a03b710e7524d4c66c23..cacf8e90b3266773be94b45e3e310868515559e6 100644 (file)
@@ -21,6 +21,12 @@ namespace System.Net {
                        }
                }
 
+               internal static TraceSource Sockets {
+                       get {
+                               return null;
+                       }
+               }
+
                [Conditional ("TRACE")]
                internal static void Enter(TraceSource traceSource, object obj, string method, object paramObject) {
                }
index 8c1d12b8aaaeea6744f18260c9f1db19986b9c64..b5fa6ee09e5f1dee58880f9f7a7a837a06aa7261 100644 (file)
@@ -37,10 +37,10 @@ namespace System.Net.Sockets
                // this version does not throw.
                internal void InternalShutdown (SocketShutdown how)
                {
-                       if (!is_connected || is_disposed)
+                       if (!is_connected || CleanedUp)
                                return;
                        int error;
-                       Shutdown_internal (safe_handle, how, out error);
+                       Shutdown_internal (m_Handle, how, out error);
                }
 
                internal IAsyncResult UnsafeBeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
@@ -86,7 +86,7 @@ namespace System.Net.Sockets
 
                internal void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue, bool silent)
                {
-                       if (is_disposed && is_closed) {
+                       if (CleanedUp && is_closed) {
                                if (silent)
                                        return;
                                throw new ObjectDisposedException (GetType ().ToString ());
@@ -94,7 +94,7 @@ namespace System.Net.Sockets
 
                        int error;
 
-                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null,
+                       SetSocketOption_internal (m_Handle, optionLevel, optionName, null,
                                null, optionValue, out error);
 
                        if (!silent && error != 0)
diff --git a/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs b/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs
deleted file mode 100644 (file)
index c608bfe..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Diagnostics.ProcessModuleCollection.cs
-//
-// Authors:
-//   Dick Porter (dick@ximian.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Ximian, Inc.  http://www.ximian.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.
-//
-
-using System.Collections;
-
-namespace System.Diagnostics 
-{
-#if MOBILE
-       public class ProcessModuleCollectionBase : System.Collections.Generic.List<ProcessModule>
-       {
-               protected ProcessModuleCollectionBase InnerList {
-                       get { return this; }
-               }
-
-               public System.Collections.IEnumerator GetEnumerator ()
-               {
-                       return ((System.Collections.IEnumerable)InnerList).GetEnumerator ();
-               }
-       }
-#endif
-
-       public class ProcessModuleCollection :
-#if !MOBILE    
-               ReadOnlyCollectionBase
-#else
-               ProcessModuleCollectionBase
-#endif
-       {
-               protected ProcessModuleCollection() 
-               {
-               }
-
-               public ProcessModuleCollection(ProcessModule[] processModules) 
-               {
-                       InnerList.AddRange (processModules);
-               }
-               
-               public ProcessModule this[int index] {
-                       get {
-                               return (ProcessModule)InnerList[index];
-                       }
-               }
-
-               public bool Contains(ProcessModule module) 
-               {
-                       return InnerList.Contains (module);
-               }
-
-               public void CopyTo(ProcessModule[] array, int index) 
-               {
-                       InnerList.CopyTo (array, index);
-               }
-
-               public int IndexOf(ProcessModule module) 
-               {
-                       return InnerList.IndexOf (module);
-               }
-       }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs b/mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs
deleted file mode 100644 (file)
index 141b182..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.Diagnostics.ProcessThreadCollection.cs
-//
-// Authors:
-//   Dick Porter (dick@ximian.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Ximian, Inc.  http://www.ximian.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.
-//
-
-using System.Collections;
-
-namespace System.Diagnostics 
-{
-#if MOBILE
-       public class ProcessThreadCollectionBase : System.Collections.Generic.List<ProcessThread>
-       {
-               protected ProcessThreadCollectionBase InnerList {
-                       get { return this; }
-               }
-
-               public new int Add (ProcessThread thread)
-               {
-                       base.Add (thread);
-                       return Count - 1;
-               }
-
-               public System.Collections.IEnumerator GetEnumerator ()
-               {
-                       return ((System.Collections.IEnumerable)InnerList).GetEnumerator ();
-               }
-       }
-#endif
-
-       public class ProcessThreadCollection :
-#if !MOBILE
-               ReadOnlyCollectionBase
-#else
-               ProcessThreadCollectionBase
-#endif
-       {
-               protected ProcessThreadCollection() 
-               {
-               }
-
-               internal static ProcessThreadCollection GetEmpty ()
-               {
-                       return new ProcessThreadCollection ();
-               }
-               
-               public ProcessThreadCollection(ProcessThread[] processThreads) 
-               {
-                       InnerList.AddRange (processThreads);
-               }
-
-               public ProcessThread this[int index] {
-                       get {
-                               return (ProcessThread)InnerList[index];
-                       }
-               }
-
-               public int Add(ProcessThread thread) 
-               {
-                       return InnerList.Add (thread);
-               }
-
-               public bool Contains(ProcessThread thread) 
-               {
-                       return InnerList.Contains (thread);
-               }
-
-               public void CopyTo(ProcessThread[] array, int index) 
-               {
-                       InnerList.CopyTo (array, index);
-               }
-
-               public int IndexOf(ProcessThread thread) 
-               {
-                       return InnerList.IndexOf (thread);
-               }
-
-               public void Insert(int index, ProcessThread thread) 
-               {
-                       InnerList.Insert (index, thread);
-               }
-
-               public void Remove(ProcessThread thread) 
-               {
-                       InnerList.Remove (thread);
-               }
-       }
-}
index 3b274e0599e3bb53e849adfb400d0b3904118e18..04bd35a142f7a54ca212fb25b2faa7cebe938cdd 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.ComponentModel;
+
 namespace System.IO
 {
-    public class FileSystemWatcher : IDisposable
+    public class FileSystemWatcher : Component, IDisposable, ISupportInitialize
     {
         public FileSystemWatcher () { throw new NotImplementedException (); }
         public FileSystemWatcher (string path) { throw new NotImplementedException (); }
@@ -39,11 +41,15 @@ namespace System.IO
         public int InternalBufferSize { get { throw new NotImplementedException (); } set { } }
         public NotifyFilters NotifyFilter { get { throw new NotImplementedException (); } set { } }
         public string Path { get { throw new NotImplementedException (); } set { } }
+        public override ISite Site { get { throw new NotImplementedException (); } set { } }
+        public ISynchronizeInvoke SynchronizingObject { get { throw new NotImplementedException (); } set { } }
         public event FileSystemEventHandler Changed;
         public event FileSystemEventHandler Created;
         public event FileSystemEventHandler Deleted;
         public event ErrorEventHandler Error;
         public event RenamedEventHandler Renamed;
+        public void BeginInit() { throw new NotImplementedException (); }
+        public void EndInit() { throw new NotImplementedException (); }
         protected void OnChanged (FileSystemEventArgs e) { throw new NotImplementedException (); }
         protected void OnCreated (FileSystemEventArgs e) { throw new NotImplementedException (); }
         protected void OnDeleted (System.IO.FileSystemEventArgs e) { throw new NotImplementedException (); }
@@ -51,13 +57,7 @@ namespace System.IO
         protected void OnRenamed (RenamedEventArgs e) { throw new NotImplementedException (); }
         public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) { throw new NotImplementedException (); }
         public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) { throw new NotImplementedException (); }
-
-        public virtual void Dispose ()
-        {
-        }
-
-        protected virtual void Dispose (bool disposing)
-        {
-        }
+        public virtual void Dispose () { throw new NotImplementedException (); }
+        protected override void Dispose (bool disposing) { throw new NotImplementedException (); }
     }
 }
\ No newline at end of file
index 40ee139b7a02fd18e26d688b314cd231dcd51318..b5a58d86b8160caadfdf41d028408ffe441e0983 100644 (file)
@@ -153,6 +153,11 @@ namespace System.Net.Mail {
                        set { bodyEncoding = value; }
                }
 
+               public TransferEncoding BodyTransferEncoding {
+                       get { return GuessTransferEncoding (BodyEncoding); }
+                       set { throw new NotImplementedException (); }
+               }
+
                public MailAddressCollection CC {
                        get { return cc; }
                }
diff --git a/mcs/class/System/System.Net.Mail/SmtpClient.platformnotsupported.cs b/mcs/class/System/System.Net.Mail/SmtpClient.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..92ef97d
--- /dev/null
@@ -0,0 +1,167 @@
+//
+// System.Net.Mail.SmtpClient.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.ComponentModel;
+using System.Security.Cryptography.X509Certificates;
+using System.Threading.Tasks;
+
+namespace System.Net.Mail {
+       public class SmtpClient
+               : IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Mail.SmtpClient is not supported on the current platform.";
+
+               public SmtpClient ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SmtpClient (string host)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SmtpClient (string host, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+#if SECURITY_DEP
+               [MonoTODO("Client certificates not used")]
+               public X509CertificateCollection ClientCertificates {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+#endif
+
+               public string TargetName { get; set; }
+
+               public ICredentialsByHost Credentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SmtpDeliveryMethod DeliveryMethod {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool EnableSsl {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Host {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string PickupDirectoryLocation {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Port {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+               
+               public SmtpDeliveryFormat DeliveryFormat {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+               
+               public ServicePoint ServicePoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Timeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseDefaultCredentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+#pragma warning disable 0067 // The event `System.Net.Mail.SmtpClient.SendCompleted' is never used
+               public event SendCompletedEventHandler SendCompleted;
+#pragma warning restore 0067
+
+               public void Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected void OnSendCompleted (AsyncCompletedEventArgs e)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Send (MailMessage message)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Send (string from, string to, string subject, string body)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task SendMailAsync (MailMessage message)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task SendMailAsync (string from, string recipients, string subject, string body)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void SendAsync (MailMessage message, object userToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void SendAsync (string from, string to, string subject, string body, object userToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void SendAsyncCancel ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
+
index 72645bcd3a712796e6c935af1280e12d887907b9..8232a9eaac445c5a035e6bff57ab6ef45357b3ff 100644 (file)
@@ -262,12 +262,12 @@ namespace System.Net.NetworkInformation {
                                bytes = new byte [100];
                                do {
                                        EndPoint endpoint = client;
-                                       int error = 0;
-                                       int rc = s.ReceiveFrom_nochecks_exc (bytes, 0, 100, SocketFlags.None,
-                                                       ref endpoint, false, out error);
+                                       SocketError error = 0;
+                                       int rc = s.ReceiveFrom (bytes, 0, 100, SocketFlags.None,
+                                                       ref endpoint, out error);
 
-                                       if (error != 0) {
-                                               if (error == (int) SocketError.TimedOut) {
+                                       if (error != SocketError.Success) {
+                                               if (error == SocketError.TimedOut) {
                                                        return new PingReply (null, new byte [0], options, 0, IPStatus.TimedOut);
                                                }
                                                throw new NotSupportedException (String.Format ("Unexpected socket error during ping request: {0}", error));
index ad9e3526ff740c4e1a682f38592ab6529ddcf54d..0ee2c7b8258f7f4fc72038ca3c99e8d243507aee 100644 (file)
@@ -148,6 +148,12 @@ namespace System.Net.Security
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState)
                {
@@ -160,6 +166,12 @@ namespace System.Net.Security
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
                {
@@ -172,12 +184,24 @@ namespace System.Net.Security
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
                {
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual IAsyncResult BeginAuthenticateAsServer (ExtendedProtectionPolicy policy, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
                {
@@ -196,6 +220,18 @@ namespace System.Net.Security
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
                {
@@ -208,6 +244,18 @@ namespace System.Net.Security
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public virtual void AuthenticateAsServer (ExtendedProtectionPolicy policy)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual void AuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
+               {
+                       throw new NotImplementedException ();
+               }
+
                [MonoTODO]
                public virtual void AuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
                {
index 44def5c75df3dc3419db01a9ef438ec3ee4ca180..e80e84ac7e840ca81706a7e9e9aa36594c143174 100644 (file)
@@ -66,16 +66,16 @@ namespace System.Net.Sockets
                bool is_closed;
 
                bool is_listening;
-               bool use_overlapped_io;
+               bool useOverlappedIO;
 
                int linger_timeout;
 
-               AddressFamily address_family;
-               SocketType socket_type;
-               ProtocolType protocol_type;
+               AddressFamily addressFamily;
+               SocketType socketType;
+               ProtocolType protocolType;
 
-               /* the field "safe_handle" is looked up by name by the runtime */
-               internal SafeSocketHandle safe_handle;
+               /* the field "m_Handle" is looked up by name by the runtime */
+               internal SafeSocketHandle m_Handle;
 
                /*
                 * This EndPoint is used when creating new endpoints. Because
@@ -86,8 +86,8 @@ namespace System.Net.Sockets
                 */
                internal EndPoint seed_endpoint = null;
 
-               internal Queue<KeyValuePair<IntPtr, IOSelectorJob>> readQ = new Queue<KeyValuePair<IntPtr, IOSelectorJob>> (2);
-               internal Queue<KeyValuePair<IntPtr, IOSelectorJob>> writeQ = new Queue<KeyValuePair<IntPtr, IOSelectorJob>> (2);
+               internal SemaphoreSlim ReadSem = new SemaphoreSlim (1, 1);
+               internal SemaphoreSlim WriteSem = new SemaphoreSlim (1, 1);
 
                internal bool is_blocking = true;
                internal bool is_bound;
@@ -95,9 +95,11 @@ namespace System.Net.Sockets
                /* When true, the socket was connected at the time of the last IO operation */
                internal bool is_connected;
 
-               internal bool is_disposed;
+               int m_IntCleanedUp;
                internal bool connect_in_progress;
 
+               private static volatile bool s_LoggingEnabled = Logging.On;
+
 #region Constructors
 
                static Socket ()
@@ -156,26 +158,14 @@ namespace System.Net.Sockets
                        }
                }
 
-               //
-               // This constructor is used by servers that want to listen for instance on both
-               // ipv4 and ipv6.   Mono has historically done that if you use InterNetworkV6 (at
-               // least on Unix), because that is the default behavior unless the IPV6_V6ONLY
-               // option is explicitly set by using setsockopt (sock, IPPROTO_IPV6, IPV6_ONLY)
-               //
-               public Socket (SocketType socketType, ProtocolType protocolType)
-                       : this (AddressFamily.InterNetworkV6, socketType, protocolType)
-               {
-                       DualMode = true;
-               }
-               
                public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
                {
-                       this.address_family = addressFamily;
-                       this.socket_type = socketType;
-                       this.protocol_type = protocolType;
+                       this.addressFamily = addressFamily;
+                       this.socketType = socketType;
+                       this.protocolType = protocolType;
 
                        int error;
-                       this.safe_handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
+                       this.m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -183,56 +173,49 @@ namespace System.Net.Sockets
                        SocketDefaults ();
                }
 
-#if !MOBILE
                public Socket (SocketInformation socketInformation)
                {
                        this.is_listening      = (socketInformation.Options & SocketInformationOptions.Listening) != 0;
                        this.is_connected      = (socketInformation.Options & SocketInformationOptions.Connected) != 0;
                        this.is_blocking       = (socketInformation.Options & SocketInformationOptions.NonBlocking) == 0;
-                       this.use_overlapped_io = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
+                       this.useOverlappedIO = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
 
                        var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
 
-                       this.address_family = (AddressFamily) (int) result [0];
-                       this.socket_type = (SocketType) (int) result [1];
-                       this.protocol_type = (ProtocolType) (int) result [2];
+                       this.addressFamily = (AddressFamily) (int) result [0];
+                       this.socketType = (SocketType) (int) result [1];
+                       this.protocolType = (ProtocolType) (int) result [2];
                        this.is_bound = (ProtocolType) (int) result [3] != 0;
-                       this.safe_handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
+                       this.m_Handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
 
                        SocketDefaults ();
                }
-#endif
 
                /* private constructor used by Accept, which already has a socket handle to use */
                internal Socket(AddressFamily family, SocketType type, ProtocolType proto, SafeSocketHandle safe_handle)
                {
-                       this.address_family = family;
-                       this.socket_type = type;
-                       this.protocol_type = proto;
+                       this.addressFamily = family;
+                       this.socketType = type;
+                       this.protocolType = proto;
                        
-                       this.safe_handle = safe_handle;
+                       this.m_Handle = safe_handle;
                        this.is_connected = true;
                }
 
-               ~Socket ()
-               {
-                       Dispose (false);
-               }
-
                void SocketDefaults ()
                {
                        try {
                                /* Need to test IPv6 further */
-                               if (address_family == AddressFamily.InterNetwork
-                                       // || address_family == AddressFamily.InterNetworkV6
+                               if (addressFamily == AddressFamily.InterNetwork
+                                       // || addressFamily == AddressFamily.InterNetworkV6
                                ) {
                                        /* This is the default, but it probably has nasty side
                                         * effects on Linux, as the socket option is kludged by
                                         * turning on or off PMTU discovery... */
                                        this.DontFragment = false;
-                                       if (protocol_type == ProtocolType.Tcp)
+                                       if (protocolType == ProtocolType.Tcp)
                                                this.NoDelay = false;
-                               } else if (address_family == AddressFamily.InterNetworkV6) {
+                               } else if (addressFamily == AddressFamily.InterNetworkV6) {
                                        this.DualMode = true;
                                }
 
@@ -306,7 +289,7 @@ namespace System.Net.Sockets
                                ThrowIfDisposedAndClosed ();
 
                                int ret, error;
-                               ret = Available_internal (safe_handle, out error);
+                               ret = Available_internal (m_Handle, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
@@ -331,40 +314,12 @@ namespace System.Net.Sockets
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                extern static int Available_internal (IntPtr socket, out int error);
 
-               public bool DontFragment {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               switch (address_family) {
-                               case AddressFamily.InterNetwork:
-                                       return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
-                               case AddressFamily.InterNetworkV6:
-                                       return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
-                               default:
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               switch (address_family) {
-                               case AddressFamily.InterNetwork:
-                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value ? 1 : 0);
-                                       break;
-                               case AddressFamily.InterNetworkV6:
-                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value ? 1 : 0);
-                                       break;
-                               default:
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                       }
-               }
-
+               // FIXME: import from referencesource
                public bool EnableBroadcast {
                        get {
                                ThrowIfDisposedAndClosed ();
 
-                               if (protocol_type != ProtocolType.Udp)
+                               if (protocolType != ProtocolType.Udp)
                                        throw new SocketException ((int) SocketError.ProtocolOption);
 
                                return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0;
@@ -372,47 +327,20 @@ namespace System.Net.Sockets
                        set {
                                ThrowIfDisposedAndClosed ();
 
-                               if (protocol_type != ProtocolType.Udp)
+                               if (protocolType != ProtocolType.Udp)
                                        throw new SocketException ((int) SocketError.ProtocolOption);
 
                                SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
                        }
                }
 
-               public bool ExclusiveAddressUse {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0;
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (is_bound)
-                                       throw new InvalidOperationException ("Bind has already been called for this socket");
-
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value ? 1 : 0);
-                       }
-               }
-
                public bool IsBound {
                        get {
                                return is_bound;
                        }
                }
 
-               public LingerOption LingerState {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return (LingerOption) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger);
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, value);
-                       }
-               }
-
+               // FIXME: import from referencesource
                public bool MulticastLoopback {
                        get {
                                ThrowIfDisposedAndClosed ();
@@ -422,10 +350,10 @@ namespace System.Net.Sockets
                                 * "Setting this property on a Transmission Control Protocol (TCP)
                                 * socket will have no effect." but the MS runtime throws the
                                 * exception...) */
-                               if (protocol_type == ProtocolType.Tcp)
+                               if (protocolType == ProtocolType.Tcp)
                                        throw new SocketException ((int)SocketError.ProtocolOption);
 
-                               switch (address_family) {
+                               switch (addressFamily) {
                                case AddressFamily.InterNetwork:
                                        return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
                                case AddressFamily.InterNetworkV6:
@@ -442,10 +370,10 @@ namespace System.Net.Sockets
                                 * "Setting this property on a Transmission Control Protocol (TCP)
                                 * socket will have no effect." but the MS runtime throws the
                                 * exception...) */
-                               if (protocol_type == ProtocolType.Tcp)
+                               if (protocolType == ProtocolType.Tcp)
                                        throw new SocketException ((int)SocketError.ProtocolOption);
 
-                               switch (address_family) {
+                               switch (addressFamily) {
                                case AddressFamily.InterNetwork:
                                        SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value ? 1 : 0);
                                        break;
@@ -458,37 +386,6 @@ namespace System.Net.Sockets
                        }
                }
 
-               public bool DualMode {
-                       get {
-                               if (AddressFamily != AddressFamily.InterNetworkV6) 
-                                       throw new NotSupportedException("This protocol version is not supported");
-
-                               return ((int)GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only) == 0);
-                       }
-                       set {
-                               if (AddressFamily != AddressFamily.InterNetworkV6) 
-                                       throw new NotSupportedException("This protocol version is not supported");
-
-                               SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, value ? 0 : 1);
-                       }
-               }
-
-               private bool IsDualMode {
-                       get {
-                               return AddressFamily == AddressFamily.InterNetworkV6 && DualMode;
-                       }
-               }
-
-               [MonoTODO ("This doesn't do anything on Mono yet")]
-               public bool UseOnlyOverlappedIO {
-                       get { return use_overlapped_io; }
-                       set { use_overlapped_io = value; }
-               }
-
-               public IntPtr Handle {
-                       get { return safe_handle.DangerousGetHandle (); }
-               }
-
                // Wish:  support non-IP endpoints.
                public EndPoint LocalEndPoint {
                        get {
@@ -500,7 +397,7 @@ namespace System.Net.Sockets
                                        return null;
 
                                int error;
-                               SocketAddress sa = LocalEndPoint_internal (safe_handle, (int) address_family, out error);
+                               SocketAddress sa = LocalEndPoint_internal (m_Handle, (int) addressFamily, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
@@ -525,61 +422,13 @@ namespace System.Net.Sockets
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                extern static SocketAddress LocalEndPoint_internal (IntPtr socket, int family, out int error);
 
-               public SocketType SocketType {
-                       get { return socket_type; }
-               }
-
-               public int SendTimeout {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (value < -1)
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
-
-                               /* According to the MSDN docs we should adjust values between 1 and
-                                * 499 to 500, but the MS runtime doesn't do this. */
-                               if (value == -1)
-                                       value = 0;
-
-                               SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
-                       }
-               }
-
-               public int ReceiveTimeout {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return (int) GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (value < -1)
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
-
-                               if (value == -1)
-                                       value = 0;
-
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
-                       }
-               }
-
-               public AddressFamily AddressFamily {
-                       get { return address_family; }
-               }
-
                public bool Blocking {
                        get { return is_blocking; }
                        set {
                                ThrowIfDisposedAndClosed ();
 
                                int error;
-                               Blocking_internal (safe_handle, value, out error);
+                               Blocking_internal (m_Handle, value, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
@@ -608,10 +457,7 @@ namespace System.Net.Sockets
                        internal set { is_connected = value; }
                }
 
-               public ProtocolType ProtocolType {
-                       get { return protocol_type; }
-               }
-
+               // FIXME: import from referencesource
                public bool NoDelay {
                        get {
                                ThrowIfDisposedAndClosed ();
@@ -627,70 +473,6 @@ namespace System.Net.Sockets
                        }
                }
 
-               public int ReceiveBufferSize {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (value < 0)
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
-                       }
-               }
-
-               public int SendBufferSize {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (value < 0)
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-
-                               SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
-                       }
-               }
-
-               public short Ttl {
-                       get {
-                               ThrowIfDisposedAndClosed ();
-
-                               switch (address_family) {
-                               case AddressFamily.InterNetwork:
-                                       return (short) (int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive);
-                               case AddressFamily.InterNetworkV6:
-                                       return (short) (int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit);
-                               default:
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                       }
-                       set {
-                               ThrowIfDisposedAndClosed ();
-
-                               if (value < 0 || value > 255)
-                                       throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero or greater than 255.");
-
-                               switch (address_family) {
-                               case AddressFamily.InterNetwork:
-                                       SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
-                                       break;
-                               case AddressFamily.InterNetworkV6:
-                                       SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
-                                       break;
-                               default:
-                                       throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
-                               }
-                       }
-               }
-
                public EndPoint RemoteEndPoint {
                        get {
                                ThrowIfDisposedAndClosed ();
@@ -701,7 +483,7 @@ namespace System.Net.Sockets
                                        return null;
 
                                int error;
-                               SocketAddress sa = RemoteEndPoint_internal (safe_handle, (int) address_family, out error);
+                               SocketAddress sa = RemoteEndPoint_internal (m_Handle, (int) addressFamily, out error);
 
                                if (error != 0)
                                        throw new SocketException (error);
@@ -822,7 +604,7 @@ namespace System.Net.Sockets
                                throw new NotSupportedException ("'mode' parameter is not valid.");
 
                        int error;
-                       bool result = Poll_internal (safe_handle, mode, microSeconds, out error);
+                       bool result = Poll_internal (m_Handle, mode, microSeconds, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -861,7 +643,7 @@ namespace System.Net.Sockets
                        ThrowIfDisposedAndClosed ();
 
                        int error = 0;
-                       SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+                       SafeSocketHandle safe_handle = Accept_internal (this.m_Handle, out error, is_blocking);
 
                        if (error != 0) {
                                if (is_closed)
@@ -882,7 +664,7 @@ namespace System.Net.Sockets
                        ThrowIfDisposedAndClosed ();
 
                        int error = 0;
-                       SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+                       SafeSocketHandle safe_handle = Accept_internal (this.m_Handle, out error, is_blocking);
 
                        if (error != 0) {
                                if (is_closed)
@@ -890,10 +672,10 @@ namespace System.Net.Sockets
                                throw new SocketException (error);
                        }
 
-                       acceptSocket.address_family = this.AddressFamily;
-                       acceptSocket.socket_type = this.SocketType;
-                       acceptSocket.protocol_type = this.ProtocolType;
-                       acceptSocket.safe_handle = safe_handle;
+                       acceptSocket.addressFamily = this.AddressFamily;
+                       acceptSocket.socketType = this.SocketType;
+                       acceptSocket.protocolType = this.ProtocolType;
+                       acceptSocket.m_Handle = safe_handle;
                        acceptSocket.is_connected = true;
                        acceptSocket.seed_endpoint = this.seed_endpoint;
                        acceptSocket.Blocking = this.Blocking;
@@ -924,7 +706,7 @@ namespace System.Net.Sockets
 
                        InitSocketAsyncEventArgs (e, AcceptAsyncCallback, e, SocketOperation.Accept);
 
-                       QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, e.socket_async_result));
+                       QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, e.socket_async_result));
 
                        return true;
                }
@@ -957,7 +739,7 @@ namespace System.Net.Sockets
 
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Accept);
 
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
+                       QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
 
                        return sockares;
                }
@@ -980,25 +762,6 @@ namespace System.Net.Sockets
                        sockares.Complete (acc_socket);
                });
 
-               public IAsyncResult BeginAccept (int receiveSize, AsyncCallback callback, object state)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       if (receiveSize < 0)
-                               throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
-
-                       SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.AcceptReceive) {
-                               Buffer = new byte [receiveSize],
-                               Offset = 0,
-                               Size = receiveSize,
-                               SockFlags = SocketFlags.None,
-                       };
-
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
-
-                       return sockares;
-               }
-
                public IAsyncResult BeginAccept (Socket acceptSocket, int receiveSize, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1029,7 +792,7 @@ namespace System.Net.Sockets
                                AcceptSocket = acceptSocket,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
+                       QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
 
                        return sockares;
                }
@@ -1055,7 +818,7 @@ namespace System.Net.Sockets
                        if (sockares.Size > 0) {
                                try {
                                        SocketError error;
-                                       total = acc_socket.Receive_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out error);
+                                       total = acc_socket.Receive (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out error);
                                        if (error != 0) {
                                                sockares.Complete (new SocketException ((int) error));
                                                return;
@@ -1076,12 +839,6 @@ namespace System.Net.Sockets
                        return EndAccept (out buffer, out bytes, result);
                }
 
-               public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
-               {
-                       int bytes;
-                       return EndAccept (out buffer, out bytes, asyncResult);
-               }
-
                public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1120,6 +877,9 @@ namespace System.Net.Sockets
 
                public void Bind (EndPoint localEP)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Sockets.Socket:Bind is not supported on this platform.");
+#else
                        ThrowIfDisposedAndClosed ();
 
                        if (localEP == null)
@@ -1131,7 +891,7 @@ namespace System.Net.Sockets
                        }
                        
                        int error;
-                       Bind_internal (safe_handle, localEP.Serialize(), out error);
+                       Bind_internal (m_Handle, localEP.Serialize(), out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -1139,6 +899,7 @@ namespace System.Net.Sockets
                                is_bound = true;
 
                        seed_endpoint = localEP;
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                private static void Bind_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
@@ -1169,7 +930,7 @@ namespace System.Net.Sockets
                                throw new SocketException ((int) SocketError.InvalidArgument);
 
                        int error;
-                       Listen_internal(safe_handle, backlog, out error);
+                       Listen_internal(m_Handle, backlog, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -1224,7 +985,7 @@ namespace System.Net.Sockets
                                
                                iep = RemapIPEndPoint (iep);
 
-                               Connect_internal (safe_handle, iep.Serialize (), out error);
+                               Connect_internal (m_Handle, iep.Serialize (), out error);
                                if (error == 0) {
                                        is_connected = true;
                                        is_bound = true;
@@ -1260,7 +1021,7 @@ namespace System.Net.Sockets
 
                        IPEndPoint ep = remoteEP as IPEndPoint;
                        /* Dgram uses Any to 'disconnect' */
-                       if (ep != null && socket_type != SocketType.Dgram) {
+                       if (ep != null && socketType != SocketType.Dgram) {
                                if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
                                        throw new SocketException ((int) SocketError.AddressNotAvailable);
                        }
@@ -1275,7 +1036,7 @@ namespace System.Net.Sockets
                        SocketAddress serial = remoteEP.Serialize ();
 
                        int error = 0;
-                       Connect_internal (safe_handle, serial, out error);
+                       Connect_internal (m_Handle, serial, out error);
 
                        if (error == 0 || error == 10035)
                                seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
@@ -1286,7 +1047,7 @@ namespace System.Net.Sockets
                                throw new SocketException (error);
                        }
 
-                       is_connected = !(socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
+                       is_connected = !(socketType == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
                        is_bound = true;
                }
 
@@ -1361,29 +1122,13 @@ namespace System.Net.Sockets
                        }
                });
 
-               public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback callback, object state)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       if (address == null)
-                               throw new ArgumentNullException ("address");
-                       if (address.ToString ().Length == 0)
-                               throw new ArgumentException ("The length of the IP address is zero");
-                       if (port <= 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
-                       if (is_listening)
-                               throw new InvalidOperationException ();
-
-                       return BeginConnect (new IPEndPoint (address, port), callback, state);
-               }
-
                public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
 
                        if (host == null)
                                throw new ArgumentNullException ("host");
-                       if (address_family != AddressFamily.InterNetwork && address_family != AddressFamily.InterNetworkV6)
+                       if (addressFamily != AddressFamily.InterNetwork && addressFamily != AddressFamily.InterNetworkV6)
                                throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
                        if (port <= 0 || port > 65535)
                                throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
@@ -1399,6 +1144,8 @@ namespace System.Net.Sockets
 
                        if (end_point == null)
                                throw new ArgumentNullException ("end_point");
+                       if (is_listening)
+                               throw new InvalidOperationException ();
 
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
                                EndPoint = end_point,
@@ -1422,8 +1169,8 @@ namespace System.Net.Sockets
                                // Calling connect() again will reset the connection attempt and cause
                                // an error. Better to just close the socket and move on.
                                connect_in_progress = false;
-                               safe_handle.Dispose ();
-                               safe_handle = new SafeSocketHandle (Socket_internal (address_family, socket_type, protocol_type, out error), true);
+                               m_Handle.Dispose ();
+                               m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
                                if (error != 0)
                                        throw new SocketException (error);
                        }
@@ -1431,7 +1178,7 @@ namespace System.Net.Sockets
                        bool blk = is_blocking;
                        if (blk)
                                Blocking = false;
-                       Connect_internal (safe_handle, end_point.Serialize (), out error);
+                       Connect_internal (m_Handle, end_point.Serialize (), out error);
                        if (blk)
                                Blocking = true;
 
@@ -1626,7 +1373,7 @@ namespace System.Net.Sockets
                        ThrowIfDisposedAndClosed ();
 
                        int error = 0;
-                       Disconnect_internal (safe_handle, reuseSocket, out error);
+                       Disconnect_internal (m_Handle, reuseSocket, out error);
 
                        if (error != 0) {
                                if (error == 50) {
@@ -1730,97 +1477,26 @@ namespace System.Net.Sockets
 
 #region Receive
 
-               public int Receive (byte [] buffer)
-               {
-                       return Receive (buffer, SocketFlags.None);
-               }
-
-               public int Receive (byte [] buffer, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
-                       SocketError error;
-                       int ret = Receive_nochecks (buffer, 0, buffer.Length, socketFlags, out error);
-
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
-                               throw new SocketException ((int) error);
-                       }
-
-                       return ret;
-               }
-
-               public int Receive (byte [] buffer, int size, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, size);
-
-                       SocketError error;
-                       int ret = Receive_nochecks (buffer, 0, size, socketFlags, out error);
-
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
-                               throw new SocketException ((int) error);
-                       }
-
-                       return ret;
-               }
-
-               public int Receive (byte [] buffer, int offset, int size, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, offset, size);
-
-                       SocketError error;
-                       int ret = Receive_nochecks (buffer, offset, size, socketFlags, out error);
-
-                       if (error != SocketError.Success) {
-                               if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
-                                       throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
-                               throw new SocketException ((int) error);
-                       }
-
-                       return ret;
-               }
-
                public int Receive (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
                        ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       return Receive_nochecks (buffer, offset, size, socketFlags, out errorCode);
-               }
-
-               public int Receive (IList<ArraySegment<byte>> buffers)
-               {
-                       SocketError error;
-                       int ret = Receive (buffers, SocketFlags.None, out error);
+                       int nativeError;
+                       int ret = Receive_internal (m_Handle, buffer, offset, size, socketFlags, out nativeError);
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+                       errorCode = (SocketError) nativeError;
+                       if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+                               is_connected = false;
+                               is_bound = false;
+                       } else {
+                               is_connected = true;
+                       }
 
                        return ret;
                }
 
-               [CLSCompliant (false)]
-               public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
-               {
-                       SocketError error;
-                       int ret = Receive (buffers, socketFlags, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return(ret);
-               }
-
                [CLSCompliant (false)]
                public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
                {
@@ -1851,7 +1527,7 @@ namespace System.Net.Sockets
                        }
 
                        try {
-                               ret = Receive_internal (safe_handle, bufarray, socketFlags, out nativeError);
+                               ret = Receive_internal (m_Handle, bufarray, socketFlags, out nativeError);
                        } finally {
                                for (int i = 0; i < numsegments; i++) {
                                        if (gch[i].IsAllocated)
@@ -1881,7 +1557,7 @@ namespace System.Net.Sockets
 
                                e.socket_async_result.Buffers = e.BufferList;
 
-                               QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, e.socket_async_result));
+                               QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, e.socket_async_result));
                        } else {
                                InitSocketAsyncEventArgs (e, ReceiveAsyncCallback, e, SocketOperation.Receive);
 
@@ -1889,7 +1565,7 @@ namespace System.Net.Sockets
                                e.socket_async_result.Offset = e.Offset;
                                e.socket_async_result.Size = e.Count;
 
-                               QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, e.socket_async_result));
+                               QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, e.socket_async_result));
                        }
 
                        return true;
@@ -1912,39 +1588,35 @@ namespace System.Net.Sockets
                        }
                });
 
-               public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
+               public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
                        ThrowIfBufferOutOfRange (buffer, offset, size);
 
+                       /* As far as I can tell from the docs and from experimentation, a pointer to the
+                        * SocketError parameter is not supposed to be saved for the async parts.  And as we don't
+                        * set any socket errors in the setup code, we just have to set it to Success. */
+                       errorCode = SocketError.Success;
+
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Receive) {
                                Buffer = buffer,
                                Offset = offset,
                                Size = size,
-                               SockFlags = socket_flags,
+                               SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
+                       QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
 
                        return sockares;
                }
 
-               public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error, AsyncCallback callback, object state)
-               {
-                       /* As far as I can tell from the docs and from experimentation, a pointer to the
-                        * SocketError parameter is not supposed to be saved for the async parts.  And as we don't
-                        * set any socket errors in the setup code, we just have to set it to Success. */
-                       error = SocketError.Success;
-                       return BeginReceive (buffer, offset, size, flags, callback, state);
-               }
-
                static IOAsyncCallback BeginReceiveCallback = new IOAsyncCallback (ares => {
                        SocketAsyncResult sockares = (SocketAsyncResult) ares;
                        int total = 0;
 
                        try {
-                               total = Receive_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+                               total = Receive_internal (sockares.socket.m_Handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
                        } catch (Exception e) {
                                sockares.Complete (e);
                                return;
@@ -1954,31 +1626,26 @@ namespace System.Net.Sockets
                });
 
                [CLSCompliant (false)]
-               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
 
                        if (buffers == null)
                                throw new ArgumentNullException ("buffers");
 
+                       /* I assume the same SocketError semantics as above */
+                       errorCode = SocketError.Success;
+
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.ReceiveGeneric) {
                                Buffers = buffers,
                                SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
+                       QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
 
                        return sockares;
                }
 
-               [CLSCompliant (false)]
-               public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
-               {
-                       /* I assume the same SocketError semantics as above */
-                       errorCode = SocketError.Success;
-                       return BeginReceive (buffers, socketFlags, callback, state);
-               }
-
                static IOAsyncCallback BeginReceiveGenericCallback = new IOAsyncCallback (ares => {
                        SocketAsyncResult sockares = (SocketAsyncResult) ares;
                        int total = 0;
@@ -1993,53 +1660,28 @@ namespace System.Net.Sockets
                        sockares.Complete (total);
                });
 
-               public int EndReceive (IAsyncResult result)
+               public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
                {
-                       SocketError error;
-                       int bytesReceived = EndReceive (result, out error);
+                       ThrowIfDisposedAndClosed ();
 
-                       if (error != SocketError.Success) {
-                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
-                                       is_connected = false;
-                               throw new SocketException ((int)error);
-                       }
-
-                       return bytesReceived;
-               }
-
-               public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
+                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
 
                        if (!sockares.IsCompleted)
                                sockares.AsyncWaitHandle.WaitOne ();
 
+                       errorCode = sockares.ErrorCode;
+
+                       if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress)
+                               is_connected = false;
+
                        // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
                        // kinds of exceptions that should be thrown.
-                       if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+                       if (errorCode == SocketError.Success)
                                sockares.CheckIfThrowDelayedException();
 
                        return sockares.Total;
                }
 
-               int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
-               {
-                       int nativeError;
-                       int ret = Receive_internal (safe_handle, buf, offset, size, flags, out nativeError);
-
-                       error = (SocketError) nativeError;
-                       if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
-                               is_connected = false;
-                               is_bound = false;
-                       } else {
-                               is_connected = true;
-                       }
-
-                       return ret;
-               }
-
                static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
                {
                        try {
@@ -2070,42 +1712,55 @@ namespace System.Net.Sockets
 
 #region ReceiveFrom
 
-               public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
+               public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       return ReceiveFrom (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
-               }
+                       if (remoteEP == null)
+                               throw new ArgumentNullException ("remoteEP");
 
-               public int ReceiveFrom (byte [] buffer, SocketFlags socketFlags, ref EndPoint remoteEP)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
+                       SocketError errorCode;
+                       int ret = ReceiveFrom (buffer, offset, size, socketFlags, ref remoteEP, out errorCode);
 
-                       return ReceiveFrom (buffer, 0, buffer.Length, socketFlags, ref remoteEP);
+                       if (errorCode != SocketError.Success)
+                               throw new SocketException (errorCode);
+
+                       return ret;
                }
 
-               public int ReceiveFrom (byte [] buffer, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
+               internal int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, out SocketError errorCode)
                {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, size);
+                       SocketAddress sockaddr = remoteEP.Serialize();
 
-                       return ReceiveFrom (buffer, 0, size, socketFlags, ref remoteEP);
-               }
+                       int nativeError;
+                       int cnt = ReceiveFrom_internal (m_Handle, buffer, offset, size, socketFlags, ref sockaddr, out nativeError);
 
-               public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, offset, size);
+                       errorCode = (SocketError) nativeError;
+                       if (errorCode != SocketError.Success) {
+                               if (errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+                                       is_connected = false;
+                               } else if (errorCode == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
+                                       errorCode = SocketError.TimedOut;
+                               }
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
+                               return 0;
+                       }
 
-                       int error;
-                       return ReceiveFrom_nochecks_exc (buffer, offset, size, socketFlags, ref remoteEP, true, out error);
+                       is_connected = true;
+                       is_bound = true;
+
+                       /* If sockaddr is null then we're a connection oriented protocol and should ignore the
+                        * remoteEP parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
+                       if (sockaddr != null) {
+                               /* Stupidly, EndPoint.Create() is an instance method */
+                               remoteEP = remoteEP.Create (sockaddr);
+                       }
+
+                       seed_endpoint = remoteEP;
+
+                       return cnt;
                }
 
                public bool ReceiveFromAsync (SocketAsyncEventArgs e)
@@ -2126,7 +1781,7 @@ namespace System.Net.Sockets
                        e.socket_async_result.EndPoint = e.RemoteEndPoint;
                        e.socket_async_result.SockFlags = e.SocketFlags;
 
-                       QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, e.socket_async_result));
+                       QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, e.socket_async_result));
 
                        return true;
                }
@@ -2165,7 +1820,7 @@ namespace System.Net.Sockets
                                EndPoint = remote_end,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
+                       QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
 
                        return sockares;
                }
@@ -2175,8 +1830,13 @@ namespace System.Net.Sockets
                        int total = 0;
 
                        try {
-                               int error;
-                               total = sockares.socket.ReceiveFrom_nochecks_exc (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, ref sockares.EndPoint, true, out error);
+                               SocketError errorCode;
+                               total = sockares.socket.ReceiveFrom (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, ref sockares.EndPoint, out errorCode);
+
+                               if (errorCode != SocketError.Success) {
+                                       sockares.Complete (new SocketException (errorCode));
+                                       return;
+                               }
                        } catch (Exception e) {
                                sockares.Complete (e);
                                return;
@@ -2204,43 +1864,7 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
-               internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
-               {
-                       SocketAddress sockaddr = remote_end.Serialize();
-
-                       int cnt = ReceiveFrom_internal (safe_handle, buf, offset, size, flags, ref sockaddr, out error);
-
-                       SocketError err = (SocketError) error;
-                       if (err != 0) {
-                               if (err != SocketError.WouldBlock && err != SocketError.InProgress) {
-                                       is_connected = false;
-                               } else if (err == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
-                                       if (throwOnError)       
-                                               throw new SocketException ((int) SocketError.TimedOut, TIMEOUT_EXCEPTION_MSG);
-                                       error = (int) SocketError.TimedOut;
-                                       return 0;
-                               }
-
-                               if (throwOnError)
-                                       throw new SocketException (error);
-
-                               return 0;
-                       }
-
-                       is_connected = true;
-                       is_bound = true;
-
-                       /* If sockaddr is null then we're a connection oriented protocol and should ignore the
-                        * remote_end parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
-                       if (sockaddr != null) {
-                               /* Stupidly, EndPoint.Create() is an instance method */
-                               remote_end = remote_end.Create (sockaddr);
-                       }
 
-                       seed_endpoint = remote_end;
-
-                       return cnt;
-               }
 
                static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error)
                {
@@ -2313,97 +1937,33 @@ namespace System.Net.Sockets
 
 #region Send
 
-               public int Send (byte [] buffer)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
-                       SocketError error;
-                       int ret = Send_nochecks (buffer, 0, buffer.Length, SocketFlags.None, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return ret;
-               }
-
-               public int Send (byte [] buffer, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
-                       SocketError error;
-                       int ret = Send_nochecks (buffer, 0, buffer.Length, socketFlags, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return ret;
-               }
-
-               public int Send (byte [] buffer, int size, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, size);
-
-                       SocketError error;
-                       int ret = Send_nochecks (buffer, 0, size, socketFlags, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return ret;
-               }
-
-               public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, offset, size);
-
-                       SocketError error;
-                       int ret = Send_nochecks (buffer, offset, size, socketFlags, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return ret;
-               }
-
                public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
                        ThrowIfBufferOutOfRange (buffer, offset, size);
 
-                       return Send_nochecks (buffer, offset, size, socketFlags, out errorCode);
-               }
-
-               public
-               int Send (IList<ArraySegment<byte>> buffers)
-               {
-                       SocketError error;
-                       int ret = Send (buffers, SocketFlags.None, out error);
-
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
-
-                       return ret;
-               }
-
-               public
-               int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
-               {
-                       SocketError error;
-                       int ret = Send (buffers, socketFlags, out error);
+                       if (size == 0) {
+                               errorCode = SocketError.Success;
+                               return 0;
+                       }
 
-                       if (error != SocketError.Success)
-                               throw new SocketException ((int) error);
+                       int nativeError;
+                       int sent = 0;
+                       do {
+                               sent += Send_internal (
+m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
+                               errorCode = (SocketError)nativeError;
+                               if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+                                       is_connected = false;
+                                       is_bound = false;
+                                       break;
+                               } else {
+                                       is_connected = true;
+                               }
+                       } while (sent < size);
 
-                       return ret;
+                       return sent;
                }
 
                [CLSCompliant (false)]
@@ -2435,7 +1995,7 @@ namespace System.Net.Sockets
                        }
 
                        try {
-                               ret = Send_internal (safe_handle, bufarray, socketFlags, out nativeError);
+                               ret = Send_internal (m_Handle, bufarray, socketFlags, out nativeError);
                        } finally {
                                for(int i = 0; i < numsegments; i++) {
                                        if (gch[i].IsAllocated) {
@@ -2449,30 +2009,6 @@ namespace System.Net.Sockets
                        return ret;
                }
 
-               int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
-               {
-                       if (size == 0) {
-                               error = SocketError.Success;
-                               return 0;
-                       }
-
-                       int nativeError;
-                       int sent = 0;
-                       do {
-                               sent += Send_internal (safe_handle, buf, offset + sent, size - sent, flags, out nativeError);
-                               error = (SocketError)nativeError;
-                               if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
-                                       is_connected = false;
-                                       is_bound = false;
-                                       break;
-                               } else {
-                                       is_connected = true;
-                               }
-                       } while (sent < size);
-
-                       return sent;
-               }
-
                public bool SendAsync (SocketAsyncEventArgs e)
                {
                        // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
@@ -2487,7 +2023,7 @@ namespace System.Net.Sockets
 
                                e.socket_async_result.Buffers = e.BufferList;
 
-                               QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, e.socket_async_result));
+                               QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, e.socket_async_result));
                        } else {
                                InitSocketAsyncEventArgs (e, SendAsyncCallback, e, SocketOperation.Send);
 
@@ -2495,7 +2031,7 @@ namespace System.Net.Sockets
                                e.socket_async_result.Offset = e.Offset;
                                e.socket_async_result.Size = e.Count;
 
-                               QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
+                               QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
                        }
 
                        return true;
@@ -2520,32 +2056,25 @@ namespace System.Net.Sockets
 
                public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
+                       ThrowIfDisposedAndClosed ();
+                       ThrowIfBufferNull (buffer);
+                       ThrowIfBufferOutOfRange (buffer, offset, size);
+
                        if (!is_connected) {
                                errorCode = SocketError.NotConnected;
-                               throw new SocketException ((int) errorCode);
+                               return null;
                        }
 
                        errorCode = SocketError.Success;
-                       return BeginSend (buffer, offset, size, socketFlags, callback, state);
-               }
-
-               public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, offset, size);
-
-                       if (!is_connected)
-                               throw new SocketException ((int)SocketError.NotConnected);
 
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Send) {
                                Buffer = buffer,
                                Offset = offset,
                                Size = size,
-                               SockFlags = socket_flags,
+                               SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
+                       QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
 
                        return sockares;
                }
@@ -2555,7 +2084,7 @@ namespace System.Net.Sockets
                        int total = 0;
 
                        try {
-                               total = Socket.Send_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+                               total = Socket.Send_internal (sockares.socket.m_Handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
                        } catch (Exception e) {
                                sockares.Complete (e);
                                return;
@@ -2566,7 +2095,7 @@ namespace System.Net.Sockets
                                sockares.Offset += total;
                                sockares.Size -= total;
 
-                               if (sockares.socket.is_disposed) {
+                               if (sockares.socket.CleanedUp) {
                                        sockares.Complete (total);
                                        return;
                                }
@@ -2582,37 +2111,31 @@ namespace System.Net.Sockets
                        sockares.Complete (total);
                }
 
-               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+               [CLSCompliant (false)]
+               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
 
                        if (buffers == null)
                                throw new ArgumentNullException ("buffers");
-                       if (!is_connected)
-                               throw new SocketException ((int)SocketError.NotConnected);
+
+                       if (!is_connected) {
+                               errorCode = SocketError.NotConnected;
+                               return null;
+                       }
+
+                       errorCode = SocketError.Success;
 
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.SendGeneric) {
                                Buffers = buffers,
                                SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
+                       QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
 
                        return sockares;
                }
 
-               [CLSCompliant (false)]
-               public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
-               {
-                       if (!is_connected) {
-                               errorCode = SocketError.NotConnected;
-                               throw new SocketException ((int)errorCode);
-                       }
-
-                       errorCode = SocketError.Success;
-                       return BeginSend (buffers, socketFlags, callback, state);
-               }
-
                static IOAsyncCallback BeginSendGenericCallback = new IOAsyncCallback (ares => {
                        SocketAsyncResult sockares = (SocketAsyncResult) ares;
                        int total = 0;
@@ -2627,20 +2150,6 @@ namespace System.Net.Sockets
                        sockares.Complete (total);
                });
 
-               public int EndSend (IAsyncResult result)
-               {
-                       SocketError error;
-                       int bytesSent = EndSend (result, out error);
-
-                       if (error != SocketError.Success) {
-                               if (error != SocketError.WouldBlock && error != SocketError.InProgress)
-                                       is_connected = false;
-                               throw new SocketException ((int)error);
-                       }
-
-                       return bytesSent;
-               }
-
                public int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2650,9 +2159,14 @@ namespace System.Net.Sockets
                        if (!sockares.IsCompleted)
                                sockares.AsyncWaitHandle.WaitOne ();
 
+                       errorCode = sockares.ErrorCode;
+
+                       if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress)
+                               is_connected = false;
+
                        /* If no socket error occurred, call CheckIfThrowDelayedException in
                         * case there are other kinds of exceptions that should be thrown.*/
-                       if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+                       if (errorCode == SocketError.Success)
                                sockares.CheckIfThrowDelayedException ();
 
                        return sockares.Total;
@@ -2690,27 +2204,6 @@ namespace System.Net.Sockets
 
 #region SendTo
 
-               public int SendTo (byte [] buffer, EndPoint remoteEP)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-
-                       return SendTo (buffer, 0, buffer.Length, SocketFlags.None, remoteEP);
-               }
-
-               public int SendTo (byte [] buffer, SocketFlags socketFlags, EndPoint remoteEP)
-               {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-
-                       return SendTo (buffer, 0, buffer.Length, socketFlags, remoteEP);
-               }
-
-               public int SendTo (byte [] buffer, int size, SocketFlags socketFlags, EndPoint remoteEP)
-               {
-                       return SendTo (buffer, 0, size, socketFlags, remoteEP);
-               }
-
                public int SendTo (byte [] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2720,7 +2213,21 @@ namespace System.Net.Sockets
                        if (remoteEP == null)
                                throw new ArgumentNullException("remoteEP");
 
-                       return SendTo_nochecks (buffer, offset, size, socketFlags, remoteEP);
+                       int error;
+                       int ret = SendTo_internal (m_Handle, buffer, offset, size, socketFlags, remoteEP.Serialize (), out error);
+
+                       SocketError err = (SocketError) error;
+                       if (err != 0) {
+                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
+                                       is_connected = false;
+                               throw new SocketException (error);
+                       }
+
+                       is_connected = true;
+                       is_bound = true;
+                       seed_endpoint = remoteEP;
+
+                       return ret;
                }
 
                public bool SendToAsync (SocketAsyncEventArgs e)
@@ -2742,7 +2249,7 @@ namespace System.Net.Sockets
                        e.socket_async_result.SockFlags = e.SocketFlags;
                        e.socket_async_result.EndPoint = e.RemoteEndPoint;
 
-                       QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
+                       QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
 
                        return true;
                }
@@ -2778,7 +2285,7 @@ namespace System.Net.Sockets
                                EndPoint = remote_end,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
+                       QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
 
                        return sockares;
                }
@@ -2787,7 +2294,7 @@ namespace System.Net.Sockets
                {
                        int total = 0;
                        try {
-                               total = sockares.socket.SendTo_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, sockares.EndPoint);
+                               total = sockares.socket.SendTo (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, sockares.EndPoint);
 
                                if (sockares.error == 0) {
                                        sent_so_far += total;
@@ -2823,25 +2330,6 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
-               int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
-               {
-                       int error;
-                       int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
-
-                       SocketError err = (SocketError) error;
-                       if (err != 0) {
-                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
-                                       is_connected = false;
-                               throw new SocketException (error);
-                       }
-
-                       is_connected = true;
-                       is_bound = true;
-                       seed_endpoint = remote_end;
-
-                       return ret;
-               }
-
                static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
                {
                        try {
@@ -2859,18 +2347,6 @@ namespace System.Net.Sockets
 
 #region SendFile
 
-               public void SendFile (string fileName)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       if (!is_connected)
-                               throw new NotSupportedException ();
-                       if (!is_blocking)
-                               throw new InvalidOperationException ();
-
-                       SendFile (fileName, null, null, 0);
-               }
-
                public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2880,7 +2356,7 @@ namespace System.Net.Sockets
                        if (!is_blocking)
                                throw new InvalidOperationException ();
 
-                       if (!SendFile_internal (safe_handle, fileName, preBuffer, postBuffer, flags)) {
+                       if (!SendFile_internal (m_Handle, fileName, preBuffer, postBuffer, flags)) {
                                SocketException exc = new SocketException ();
                                if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
                                        throw new FileNotFoundException ();
@@ -2888,18 +2364,6 @@ namespace System.Net.Sockets
                        }
                }
 
-               public IAsyncResult BeginSendFile (string fileName, AsyncCallback callback, object state)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       if (!is_connected)
-                               throw new NotSupportedException ();
-                       if (!File.Exists (fileName))
-                               throw new FileNotFoundException ();
-
-                       return BeginSendFile (fileName, null, null, 0, callback, state);
-               }
-
                public IAsyncResult BeginSendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2996,7 +2460,6 @@ namespace System.Net.Sockets
 
 #region DuplicateAndClose
 
-#if !MOBILE
                [MonoLimitation ("We do not support passing sockets across processes, we merely allow this API to pass the socket across AppDomains")]
                public SocketInformation DuplicateAndClose (int targetProcessId)
                {
@@ -3005,14 +2468,13 @@ namespace System.Net.Sockets
                                (is_listening      ? SocketInformationOptions.Listening : 0) |
                                (is_connected      ? SocketInformationOptions.Connected : 0) |
                                (is_blocking       ? 0 : SocketInformationOptions.NonBlocking) |
-                               (use_overlapped_io ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
+                               (useOverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
 
-                       si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, is_bound ? 1 : 0, (long)Handle);
-                       safe_handle = null;
+                       si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)addressFamily, (int)socketType, (int)protocolType, is_bound ? 1 : 0, (long)Handle);
+                       m_Handle = null;
 
                        return si;
                }
-#endif
 
 #endregion
 
@@ -3026,7 +2488,7 @@ namespace System.Net.Sockets
                                throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
 
                        int error;
-                       GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref optionValue, out error);
+                       GetSocketOption_arr_internal (m_Handle, optionLevel, optionName, ref optionValue, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -3038,7 +2500,7 @@ namespace System.Net.Sockets
 
                        int error;
                        byte[] byte_val = new byte [optionLength];
-                       GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref byte_val, out error);
+                       GetSocketOption_arr_internal (m_Handle, optionLevel, optionName, ref byte_val, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -3052,7 +2514,7 @@ namespace System.Net.Sockets
 
                        int error;
                        object obj_val;
-                       GetSocketOption_obj_internal (safe_handle, optionLevel, optionName, out obj_val, out error);
+                       GetSocketOption_obj_internal (m_Handle, optionLevel, optionName, out obj_val, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -3110,7 +2572,7 @@ namespace System.Net.Sockets
                                throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
 
                        int error;
-                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null, optionValue, 0, out error);
+                       SetSocketOption_internal (m_Handle, optionLevel, optionName, null, optionValue, 0, out error);
 
                        if (error != 0) {
                                if (error == (int) SocketError.InvalidArgument)
@@ -3133,17 +2595,17 @@ namespace System.Net.Sockets
                                LingerOption linger = optionValue as LingerOption;
                                if (linger == null)
                                        throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (safe_handle, optionLevel, optionName, linger, null, 0, out error);
+                               SetSocketOption_internal (m_Handle, optionLevel, optionName, linger, null, 0, out error);
                        } else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
                                MulticastOption multicast = optionValue as MulticastOption;
                                if (multicast == null)
                                        throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+                               SetSocketOption_internal (m_Handle, optionLevel, optionName, multicast, null, 0, out error);
                        } else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
                                IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
                                if (multicast == null)
                                        throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
-                               SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+                               SetSocketOption_internal (m_Handle, optionLevel, optionName, multicast, null, 0, out error);
                        } else {
                                throw new ArgumentException ("Invalid value specified.", "optionValue");
                        }
@@ -3166,11 +2628,11 @@ namespace System.Net.Sockets
                {
                        ThrowIfDisposedAndClosed ();
 
-                       if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocol_type))
+                       if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocolType))
                                throw new SocketException ((int) SocketError.OperationNotSupported, "Operating system sockets do not support ReuseAddress.\nIf your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.");
 
                        int error;
-                       SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, optionValue, out error);
+                       SetSocketOption_internal (m_Handle, optionLevel, optionName, null, null, optionValue, out error);
 
                        if (error != 0) {
                                if (error == (int) SocketError.InvalidArgument)
@@ -3200,11 +2662,11 @@ namespace System.Net.Sockets
 
                public int IOControl (int ioControlCode, byte [] optionInValue, byte [] optionOutValue)
                {
-                       if (is_disposed)
+                       if (CleanedUp)
                                throw new ObjectDisposedException (GetType ().ToString ());
 
                        int error;
-                       int result = IOControl_internal (safe_handle, ioControlCode, optionInValue, optionOutValue, out error);
+                       int result = IOControl_internal (m_Handle, ioControlCode, optionInValue, optionOutValue, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -3214,11 +2676,6 @@ namespace System.Net.Sockets
                        return result;
                }
 
-               public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
-               {
-                       return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
-               }
-
                static int IOControl_internal (SafeSocketHandle safeHandle, int ioctl_code, byte [] input, byte [] output, out int error)
                {
                        bool release = false;
@@ -3268,7 +2725,7 @@ namespace System.Net.Sockets
                                throw new SocketException (10057); // Not connected
 
                        int error;
-                       Shutdown_internal (safe_handle, how, out error);
+                       Shutdown_internal (m_Handle, how, out error);
 
                        if (error != 0)
                                throw new SocketException (error);
@@ -3295,30 +2752,24 @@ namespace System.Net.Sockets
 
                protected virtual void Dispose (bool disposing)
                {
-                       if (is_disposed)
+                       if (CleanedUp)
                                return;
 
-                       is_disposed = true;
+                       m_IntCleanedUp = 1;
                        bool was_connected = is_connected;
                        is_connected = false;
 
-                       if (safe_handle != null) {
+                       if (m_Handle != null) {
                                is_closed = true;
                                IntPtr x = Handle;
 
                                if (was_connected)
                                        Linger (x);
 
-                               safe_handle.Dispose ();
+                               m_Handle.Dispose ();
                        }
                }
 
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
                void Linger (IntPtr handle)
                {
                        if (!is_connected || linger_timeout <= 0)
@@ -3353,13 +2804,13 @@ namespace System.Net.Sockets
 
                void ThrowIfDisposedAndClosed (Socket socket)
                {
-                       if (socket.is_disposed && socket.is_closed)
+                       if (socket.CleanedUp && socket.is_closed)
                                throw new ObjectDisposedException (socket.GetType ().ToString ());
                }
 
                void ThrowIfDisposedAndClosed ()
                {
-                       if (is_disposed && is_closed)
+                       if (CleanedUp && is_closed)
                                throw new ObjectDisposedException (GetType ().ToString ());
                }
 
@@ -3383,7 +2834,7 @@ namespace System.Net.Sockets
 
                void ThrowIfUdp ()
                {
-                       if (protocol_type == ProtocolType.Udp)
+                       if (protocolType == ProtocolType.Udp)
                                throw new SocketException ((int)SocketError.ProtocolOption);
                }
 
@@ -3401,16 +2852,16 @@ namespace System.Net.Sockets
                        return sockares;
                }
 
-               void QueueIOSelectorJob (Queue<KeyValuePair<IntPtr, IOSelectorJob>> queue, IntPtr handle, IOSelectorJob job)
+               void QueueIOSelectorJob (SemaphoreSlim sem, IntPtr handle, IOSelectorJob job)
                {
-                       int count;
-                       lock (queue) {
-                               queue.Enqueue (new KeyValuePair<IntPtr, IOSelectorJob> (handle, job));
-                               count = queue.Count;
-                       }
+                       sem.WaitAsync ().ContinueWith (t => {
+                               if (CleanedUp) {
+                                       job.MarkDisposed ();
+                                       return;
+                               }
 
-                       if (count == 1)
                                IOSelector.Add (handle, job);
+                       });
                }
 
                void InitSocketAsyncEventArgs (SocketAsyncEventArgs e, AsyncCallback callback, object state, SocketOperation operation)
index 361f55ec929b450e147b04dbfb7a07794b36f485..438d4bc31e9a3dcf97f763d3ba444272030d218d 100644 (file)
@@ -111,12 +111,10 @@ namespace System.Net.Sockets
                        set;
                }
 
-#if !MOBILE
                public TransmitFileOptions SendPacketsFlags {
                        get;
                        set;
                }
-#endif
 
                [MonoTODO ("unused property")]
                public int SendPacketsSendSize {
index 980ad06e5b2f909333222afba5fea6ea9da6ead2..c63b1781660d77a48c9dd8b8f77dc1aae07f7a8a 100644 (file)
@@ -140,7 +140,7 @@ namespace System.Net.Sockets
 
                public void Complete ()
                {
-                       if (operation != SocketOperation.Receive && socket.is_disposed)
+                       if (operation != SocketOperation.Receive && socket.CleanedUp)
                                DelayedException = new ObjectDisposedException (socket.GetType ().ToString ());
 
                        IsCompleted = true;
@@ -150,42 +150,20 @@ namespace System.Net.Sockets
                                ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
                        }
 
-                       Queue<KeyValuePair<IntPtr, IOSelectorJob>> queue = null;
                        switch (operation) {
                        case SocketOperation.Receive:
                        case SocketOperation.ReceiveFrom:
                        case SocketOperation.ReceiveGeneric:
                        case SocketOperation.Accept:
-                               queue = socket.readQ;
+                               socket.ReadSem.Release ();
                                break;
                        case SocketOperation.Send:
                        case SocketOperation.SendTo:
                        case SocketOperation.SendGeneric:
-                               queue = socket.writeQ;
+                               socket.WriteSem.Release ();
                                break;
                        }
 
-                       if (queue != null) {
-                               lock (queue) {
-                                       /* queue.Count will only be 0 if the socket is closed while receive/send/accept
-                                        * operation(s) are pending and at least one call to this method is waiting
-                                        * on the lock while another one calls CompleteAllOnDispose() */
-                                       if (queue.Count > 0)
-                                               queue.Dequeue (); /* remove ourselves */
-                                       if (queue.Count > 0) {
-                                               if (!socket.is_disposed) {
-                                                       IOSelector.Add (queue.Peek ().Key, queue.Peek ().Value);
-                                               } else {
-                                                       /* CompleteAllOnDispose */
-                                                       KeyValuePair<IntPtr, IOSelectorJob> [] jobs = queue.ToArray ();
-                                                       for (int i = 0; i < jobs.Length; i++)
-                                                               ThreadPool.QueueUserWorkItem (j => ((IOSelectorJob) j).MarkDisposed (), jobs [i].Value);
-                                                       queue.Clear ();
-                                               }
-                                       }
-                               }
-                       }
-
                        // IMPORTANT: 'callback', if any is scheduled from unmanaged code
                }
 
diff --git a/mcs/class/System/System.Net.Sockets/TcpClient.platformnotsupported.cs b/mcs/class/System/System.Net.Sockets/TcpClient.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..dd69a39
--- /dev/null
@@ -0,0 +1,191 @@
+//
+// System.Net.Sockets.TcpClient.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System;
+using System.Net;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+       public class TcpClient : IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Sockets.TcpClient is not supported on the current platform.";
+
+               public TcpClient ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpClient (AddressFamily family)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpClient (IPEndPoint localEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpClient (string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected bool Active {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Socket Client {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Available {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool Connected {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool ExclusiveAddressUse {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public LingerOption LingerState {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool NoDelay {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ReceiveBufferSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ReceiveTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int SendBufferSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int SendTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (IPEndPoint remoteEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (IPAddress address, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (IPAddress[] ipAddresses, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void EndConnect (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               ~TcpClient ()
+               {
+               }
+
+               public NetworkStream GetStream()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task ConnectAsync (IPAddress address, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task ConnectAsync (IPAddress[] addresses, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task ConnectAsync (string host, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 8ab582e5541015b6ac27c447d92cc37ebdc06e35..e8b8ec40e0e2e9cdfd183205647328730cbdec8b 100644 (file)
@@ -200,7 +200,29 @@ namespace System.Net.Sockets
                        
                        return client;
                }
-               
+
+               public void AllowNatTraversal (bool allowed)
+               {
+                       if (active)
+                               throw new InvalidOperationException (SR.GetString (SR.net_tcplistener_mustbestopped));
+
+                       if (allowed)
+                               server.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
+                       else
+                               server.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
+               }
+
+               public static TcpListener Create (int port)
+               {
+                       if (port < 0 || port > 65535)
+                               throw new ArgumentOutOfRangeException ("port");
+
+                       TcpListener listener = new TcpListener (IPAddress.IPv6Any, port);
+                       listener.Server.DualMode = true;
+
+                       return listener;
+               }
+
                /// <summary>
                /// Destructor - stops the listener listening
                /// </summary>
diff --git a/mcs/class/System/System.Net.Sockets/TcpListener.platformnotsupported.cs b/mcs/class/System/System.Net.Sockets/TcpListener.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..7b64967
--- /dev/null
@@ -0,0 +1,135 @@
+//
+// System.Net.Sockets.TcpListener.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System;
+using System.Net;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+       public class TcpListener
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Sockets.TcpListener is not supported on the current platform.";
+
+               public TcpListener (int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpListener (IPEndPoint localEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpListener (IPAddress localaddr, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected bool Active {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public EndPoint LocalEndpoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Socket Server {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool ExclusiveAddressUse {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Socket AcceptSocket ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpClient AcceptTcpClient ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               ~TcpListener ()
+               {
+               }
+
+               public bool Pending ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Start ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Start (int backlog)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginAcceptSocket (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginAcceptTcpClient (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Socket EndAcceptSocket (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TcpClient EndAcceptTcpClient (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Stop ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<Socket> AcceptSocketAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<TcpClient> AcceptTcpClientAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index ad3c4117f58a06d44f4be17f73adb7f2a8668cc3..c82529b32b96f64cbf69fe8dee8decfe9036ced6 100644 (file)
@@ -125,6 +125,14 @@ namespace System.Net.Sockets
                                socket.Bind (localEP);
                }
 
+               public void AllowNatTraversal (bool allowed)
+               {
+                       if (allowed)
+                               socket.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
+                       else
+                               socket.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
+               }
+
                public void Close ()
                {
                        Dispose ();
diff --git a/mcs/class/System/System.Net.Sockets/UdpClient.platformnotsupported.cs b/mcs/class/System/System.Net.Sockets/UdpClient.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..9533501
--- /dev/null
@@ -0,0 +1,241 @@
+//
+// System.Net.Sockets.UdpClient.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+       public class UdpClient : IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Sockets.UdpClient is not supported on the current platform.";
+
+               public UdpClient ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public UdpClient(AddressFamily family)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public UdpClient (int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public UdpClient (IPEndPoint localEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public UdpClient (int port, AddressFamily family)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public UdpClient (string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (IPEndPoint endPoint)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (IPAddress addr, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Connect (string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void DropMulticastGroup (IPAddress multicastAddr)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void DropMulticastGroup (IPAddress multicastAddr, int ifindex)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void JoinMulticastGroup (IPAddress multicastAddr)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void JoinMulticastGroup (int ifindex, IPAddress multicastAddr)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void JoinMulticastGroup (IPAddress multicastAddr, int timeToLive)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void JoinMulticastGroup (IPAddress multicastAddr, IPAddress localAddress)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public byte [] Receive (ref IPEndPoint remoteEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int Send (byte [] dgram, int bytes)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int Send (byte [] dgram, int bytes, IPEndPoint endPoint)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int Send (byte [] dgram, int bytes, string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginSend (byte[] datagram, int bytes, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginSend (byte[] datagram, int bytes, IPEndPoint endPoint, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginSend (byte[] datagram, int bytes, string hostname, int port, AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int EndSend (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginReceive (AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public byte[] EndReceive (IAsyncResult asyncResult, ref IPEndPoint remoteEP)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected bool Active {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Socket Client {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Available {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool DontFragment {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool EnableBroadcast {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool ExclusiveAddressUse {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool MulticastLoopback {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public short Ttl {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               ~UdpClient ()
+               {
+               }
+
+               public Task<UdpReceiveResult> ReceiveAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<int> SendAsync (byte[] datagram, int bytes)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<int> SendAsync (byte[] datagram, int bytes, IPEndPoint endPoint)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<int> SendAsync (byte[] datagram, int bytes, string hostname, int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net.WebSockets/ClientWebSocket.platformnotsupported.cs b/mcs/class/System/System.Net.WebSockets/ClientWebSocket.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..324ae42
--- /dev/null
@@ -0,0 +1,98 @@
+//
+// ClientWebSocket.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Net.WebSockets
+{
+       public class ClientWebSocket : WebSocket, IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.WebSockets.ClientWebSocket is not supported on the current platform.";
+
+               public ClientWebSocket ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Abort ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public ClientWebSocketOptions Options {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebSocketState State {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebSocketCloseStatus? CloseStatus {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string CloseStatusDescription {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string SubProtocol {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Task ConnectAsync (Uri uri, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task SendAsync (ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task<WebSocketReceiveResult> ReceiveAsync (ArraySegment<byte> buffer, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task CloseAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task CloseOutputAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 1ed7dfe075f6775de58a51649bb11d06c9bf9bc9..98200b45b4a01ad613756f7d16839f978ce1e08f 100644 (file)
@@ -106,6 +106,13 @@ namespace System.Net
                        }
                }
 
+               [MonoTODO]
+               internal static bool OSSupportsExtendedProtection {
+                       get {
+                               return false;
+                       }
+               }
+
                internal static void Clear ()
                {
                        EnsureModules ();
index 9045052ccf7a35a917619dcc0ee4d1fdd6cb5aa8..806bfc119d6e52d9f4157c3ba1552643104a9beb 100644 (file)
@@ -130,6 +130,9 @@ namespace System.Net {
                [Obsolete ("Use BeginGetHostEntry instead")]
                public static IAsyncResult BeginGetHostByName (string hostName, AsyncCallback requestCallback, object stateObject)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Dns:BeginGetHostByName is not supported on this platform.");
+#else
                        if (hostName == null)
                                throw new ArgumentNullException ("hostName");
 
@@ -140,11 +143,15 @@ namespace System.Net {
 
                        GetHostByNameCallback c = new GetHostByNameCallback (GetHostByName);
                        return c.BeginInvoke (hostName, requestCallback, stateObject);
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                [Obsolete ("Use BeginGetHostEntry instead")]
                public static IAsyncResult BeginResolve (string hostName, AsyncCallback requestCallback, object stateObject)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Dns:BeginResolve is not supported on this platform.");
+#else
                        if (hostName == null)
                                throw new ArgumentNullException ("hostName");
 
@@ -155,6 +162,7 @@ namespace System.Net {
 
                        ResolveCallback c = new ResolveCallback (Resolve);
                        return c.BeginInvoke (hostName, requestCallback, stateObject);
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                public static IAsyncResult BeginGetHostAddresses (string hostNameOrAddress, AsyncCallback requestCallback, object state)
@@ -178,6 +186,9 @@ namespace System.Net {
 
                public static IAsyncResult BeginGetHostEntry (string hostNameOrAddress, AsyncCallback requestCallback, object stateObject)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Dns:GetHostEntry is not supported on this platform.");
+#else
                        if (hostNameOrAddress == null)
                                throw new ArgumentNullException ("hostName");
                        if (hostNameOrAddress == "0.0.0.0" || hostNameOrAddress == "::0")
@@ -193,10 +204,14 @@ namespace System.Net {
 
                        GetHostEntryNameCallback c = new GetHostEntryNameCallback (GetHostEntry);
                        return c.BeginInvoke (hostNameOrAddress, requestCallback, stateObject);
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                public static IAsyncResult BeginGetHostEntry (IPAddress address, AsyncCallback requestCallback, object stateObject)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Dns:BeginGetHostEntry is not supported on this platform.");
+#else
                        if (address == null)
                                throw new ArgumentNullException ("address");
 
@@ -207,6 +222,7 @@ namespace System.Net {
 
                        GetHostEntryIPCallback c = new GetHostEntryIPCallback (GetHostEntry);
                        return c.BeginInvoke (address, requestCallback, stateObject);
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                [Obsolete ("Use EndGetHostEntry instead")]
@@ -409,6 +425,10 @@ namespace System.Net {
                [Obsolete ("Use GetHostEntry instead")]
                public static IPHostEntry GetHostByName (string hostName)
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       if (!string.IsNullOrEmpty (hostName))
+                               throw new PlatformNotSupportedException ("System.Net.Dns:GetHostByName is not supported on this platform.");
+#endif // FEATURE_NO_BSD_SOCKETS
                        if (hostName == null)
                                throw new ArgumentNullException ("hostName");
                        string h_name;
@@ -436,6 +456,9 @@ namespace System.Net {
                [Obsolete ("Use GetHostEntry instead")]
                public static IPHostEntry Resolve(string hostName) 
                {
+#if FEATURE_NO_BSD_SOCKETS
+                       throw new PlatformNotSupportedException ("System.Net.Dns:Resolve is not supported on this platform.");
+#else
                        if (hostName == null)
                                throw new ArgumentNullException ("hostName");
 
@@ -450,6 +473,7 @@ namespace System.Net {
                                ret =  GetHostByName(hostName);
 
                        return ret;
+#endif // FEATURE_NO_BSD_SOCKETS
                }
 
                public static Task<IPAddress[]> GetHostAddressesAsync (string hostNameOrAddress)
diff --git a/mcs/class/System/System.Net/FtpRequestCreator.platformnotsupported.cs b/mcs/class/System/System.Net/FtpRequestCreator.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..ae365c2
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// System.Net.FtpbRequestCreator.cs
+//
+// Authors:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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
+{
+       class FtpRequestCreator : IWebRequestCreate
+       {
+               internal const string EXCEPTION_MESSAGE = "System.Net.FtpRequestCreator is not supported on the current platform.";
+               public WebRequest Create (Uri uri)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net/FtpWebRequest.platformnotsupported.cs b/mcs/class/System/System.Net/FtpWebRequest.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..2bb79d7
--- /dev/null
@@ -0,0 +1,182 @@
+//
+// System.Net.FtpWebRequest.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.IO;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.Net
+{
+       public sealed class FtpWebRequest : WebRequest
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.FtpWebRequest is not supported on the current platform.";
+
+               FtpWebRequest ()
+               {
+               }
+
+               public X509CertificateCollection ClientCertificates {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ConnectionGroupName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ContentType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override long ContentLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public long ContentOffset {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override ICredentials Credentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+#if !MOBILE
+               public static new RequestCachePolicy DefaultCachePolicy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+#endif
+
+               public bool EnableSsl {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebHeaderCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool KeepAlive {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string Method {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool PreAuthenticate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override IWebProxy Proxy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ReadWriteTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string RenameTo {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override Uri RequestUri {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ServicePoint ServicePoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UsePassive {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool UseDefaultCredentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseBinary {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int Timeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override void Abort ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override WebResponse EndGetResponse (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override WebResponse GetResponse ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream EndGetRequestStream (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream GetRequestStream ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net/FtpWebResponse.platformnotsupported.cs b/mcs/class/System/System.Net/FtpWebResponse.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..cd4fa71
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// System.Net.FtpWebResponse.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.IO;
+
+namespace System.Net
+{
+       public class FtpWebResponse : WebResponse
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.FtpWebResponse is not supported on the current platform.";
+
+               FtpWebResponse ()
+               {
+               }
+
+               public override long ContentLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebHeaderCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override Uri ResponseUri {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DateTime LastModified {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string BannerMessage {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string WelcomeMessage {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string ExitMessage {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public FtpStatusCode StatusCode {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool SupportsHeaders {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string StatusDescription {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream GetResponseStream ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 29afc0fd84b78ceca4e33b0dfe9efa2b4f9767fd..716229d8b565b0bcc0a00b3894274f2565c3282e 100644 (file)
@@ -42,6 +42,7 @@ using System.IO;
 using System.Collections;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Security.Authentication.ExtendedProtection;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 
@@ -69,6 +70,12 @@ namespace System.Net {
                ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue;
                Hashtable connections;
 
+               ServiceNameStore defaultServiceNames;
+               ExtendedProtectionPolicy extendedProtectionPolicy;
+               ExtendedProtectionSelector extendedProtectionSelectorDelegate;
+
+               public delegate ExtendedProtectionPolicy ExtendedProtectionSelector (HttpListenerRequest request);
+
                public HttpListener ()
                {
                        prefixes = new HttpListenerPrefixCollection (this);
@@ -77,6 +84,8 @@ namespace System.Net {
                        ctx_queue = new ArrayList ();
                        wait_queue = new ArrayList ();
                        auth_schemes = AuthenticationSchemes.Anonymous;
+                       defaultServiceNames = new ServiceNameStore ();
+                       extendedProtectionPolicy = new ExtendedProtectionPolicy (PolicyEnforcement.Never);
                }
 
                internal HttpListener (X509Certificate certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
@@ -146,6 +155,21 @@ namespace System.Net {
                        }
                }
 
+               public ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
+               {
+                       get { return extendedProtectionSelectorDelegate; }
+                       set {
+                               CheckDisposed();
+                               if (value == null)
+                                       throw new ArgumentNullException ();
+
+                               if (!AuthenticationManager.OSSupportsExtendedProtection)
+                                       throw new PlatformNotSupportedException (SR.GetString (SR.security_ExtendedProtection_NoOSSupport));
+
+                               extendedProtectionSelectorDelegate = value;
+                       }
+               }
+
                public bool IgnoreWriteExceptions {
                        get { return ignore_write_exceptions; }
                        set {
@@ -169,6 +193,42 @@ namespace System.Net {
                        }
                }
 
+               [MonoTODO]
+               public HttpListenerTimeoutManager TimeoutManager {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               [MonoTODO ("not used anywhere in the implementation")]
+               public ExtendedProtectionPolicy ExtendedProtectionPolicy
+               {
+                       get {
+                               return extendedProtectionPolicy;
+                       }
+                       set {
+                               CheckDisposed ();
+
+                               if (value == null)
+                                       throw new ArgumentNullException ("value");
+
+                               if (!AuthenticationManager.OSSupportsExtendedProtection && value.PolicyEnforcement == PolicyEnforcement.Always)
+                                       throw new PlatformNotSupportedException (SR.GetString(SR.security_ExtendedProtection_NoOSSupport));
+
+                               if (value.CustomChannelBinding != null)
+                                       throw new ArgumentException (SR.GetString (SR.net_listener_cannot_set_custom_cbt), "CustomChannelBinding");
+                               extendedProtectionPolicy = value;
+                       }
+               }
+
+               public ServiceNameCollection DefaultServiceNames
+               {
+                       get {
+                               return defaultServiceNames.ServiceNames;
+                       }
+               }
+
                // TODO: use this
                public string Realm {
                        get { return realm; }
diff --git a/mcs/class/System/System.Net/HttpListener.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListener.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..b37b9d3
--- /dev/null
@@ -0,0 +1,128 @@
+//
+// System.Net.HttpListener
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Threading.Tasks;
+
+namespace System.Net {
+       public sealed class HttpListener : IDisposable
+       {
+               internal const string EXCEPTION_MESSAGE = "System.Net.HttpListener is not supported on the current platform.";
+
+               public HttpListener ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal HttpListener (System.Security.Cryptography.X509Certificates.X509Certificate certificate, Mono.Net.Security.IMonoTlsProvider tlsProvider, Mono.Security.Interface.MonoTlsSettings tlsSettings)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public AuthenticationSchemes AuthenticationSchemes {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IgnoreWriteExceptions {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsListening {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool IsSupported {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public HttpListenerPrefixCollection Prefixes {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Realm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UnsafeConnectionNtlmAuthentication {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void Abort ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginGetContext (AsyncCallback callback, Object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public HttpListenerContext EndGetContext (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public HttpListenerContext GetContext ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Start ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Stop ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               void IDisposable.Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<HttpListenerContext> GetContextAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index d495e4af581e281bb88a1eceb6f4c6f4f8d1309a..5a3a2f0f445be565d7b01433dce630f5c6d7cccb 100644 (file)
@@ -137,16 +137,25 @@ namespace System.Net {
                        } 
                }
 
+               [MonoTODO]
                public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol)
                {
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
+               public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, TimeSpan keepAliveInterval)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
                public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
                {
                        throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
                {
                        throw new NotImplementedException ();
diff --git a/mcs/class/System/System.Net/HttpListenerContext.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListenerContext.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..4c729de
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// System.Net.HttpListenerContext
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Security.Principal;
+using System.Threading.Tasks;
+using System.Net.WebSockets;
+
+namespace System.Net {
+       public sealed class HttpListenerContext {
+               const string EXCEPTION_MESSAGE = "System.Net.HttpListenerContext is not supported on the current platform.";
+
+               HttpListenerContext ()
+               {
+               }
+
+               public HttpListenerRequest Request {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public HttpListenerResponse Response {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IPrincipal User {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net/HttpListenerPrefixCollection.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListenerPrefixCollection.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..e3566c2
--- /dev/null
@@ -0,0 +1,93 @@
+//
+// System.Net.HttpListenerPrefixCollection.cs
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System.Net {
+       public class HttpListenerPrefixCollection : ICollection<string>, IEnumerable<string>, IEnumerable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.HttpListenerPrefixCollection is not supported on the current platform.";
+
+               HttpListenerPrefixCollection ()
+               {
+               }
+
+               public int Count {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsReadOnly {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsSynchronized {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void Add (string uriPrefix)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Clear ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public bool Contains (string uriPrefix)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void CopyTo (string [] array, int offset)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void CopyTo (Array array, int offset)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IEnumerator<string> GetEnumerator ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               IEnumerator IEnumerable.GetEnumerator ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public bool Remove (string uriPrefix)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net/HttpListenerRequest.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListenerRequest.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..32560d9
--- /dev/null
@@ -0,0 +1,180 @@
+//
+// System.Net.HttpListenerRequest
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.Collections.Specialized;
+using System.IO;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace System.Net {
+       public sealed class HttpListenerRequest
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.HttpListenerRequest is not supported on the current platform.";
+
+               HttpListenerRequest ()
+               {
+               }
+
+               public string [] AcceptTypes {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ClientCertificateError {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Encoding ContentEncoding {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public long ContentLength64 {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string ContentType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public CookieCollection Cookies {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool HasEntityBody {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public NameValueCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string HttpMethod {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Stream InputStream {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsAuthenticated {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsLocal {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsSecureConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool KeepAlive {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IPEndPoint LocalEndPoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Version ProtocolVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public NameValueCollection QueryString {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string RawUrl {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IPEndPoint RemoteEndPoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Guid RequestTraceIdentifier {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Uri Url {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Uri UrlReferrer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string UserAgent {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string UserHostAddress {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string UserHostName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string [] UserLanguages {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IAsyncResult BeginGetClientCertificate (AsyncCallback requestCallback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public X509Certificate2 EndGetClientCertificate (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public X509Certificate2 GetClientCertificate ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public string ServiceName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public TransportContext TransportContext {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool IsWebSocketRequest {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Task<X509Certificate2> GetClientCertificateAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 15ec5bb59dbf74ce6b8206c6acb1f2a0dc66eaad..73aa6396b5343e27c1ae1808bc72a7c6470053a5 100644 (file)
@@ -517,64 +517,6 @@ namespace System.Net {
                        cookies.Add (cookie);
                }
        }
-
-       // do not inline into HttpListenerResponse as this recursively brings everything that's 
-       // reachable by IDisposable.Dispose (and that's quite a lot in this case). 
-       static class HttpListenerResponseHelper {
-
-               internal static string GetStatusDescription (int code)
-               {
-                       switch (code){
-                       case 100: return "Continue";
-                       case 101: return "Switching Protocols";
-                       case 102: return "Processing";
-                       case 200: return "OK";
-                       case 201: return "Created";
-                       case 202: return "Accepted";
-                       case 203: return "Non-Authoritative Information";
-                       case 204: return "No Content";
-                       case 205: return "Reset Content";
-                       case 206: return "Partial Content";
-                       case 207: return "Multi-Status";
-                       case 300: return "Multiple Choices";
-                       case 301: return "Moved Permanently";
-                       case 302: return "Found";
-                       case 303: return "See Other";
-                       case 304: return "Not Modified";
-                       case 305: return "Use Proxy";
-                       case 307: return "Temporary Redirect";
-                       case 400: return "Bad Request";
-                       case 401: return "Unauthorized";
-                       case 402: return "Payment Required";
-                       case 403: return "Forbidden";
-                       case 404: return "Not Found";
-                       case 405: return "Method Not Allowed";
-                       case 406: return "Not Acceptable";
-                       case 407: return "Proxy Authentication Required";
-                       case 408: return "Request Timeout";
-                       case 409: return "Conflict";
-                       case 410: return "Gone";
-                       case 411: return "Length Required";
-                       case 412: return "Precondition Failed";
-                       case 413: return "Request Entity Too Large";
-                       case 414: return "Request-Uri Too Long";
-                       case 415: return "Unsupported Media Type";
-                       case 416: return "Requested Range Not Satisfiable";
-                       case 417: return "Expectation Failed";
-                       case 422: return "Unprocessable Entity";
-                       case 423: return "Locked";
-                       case 424: return "Failed Dependency";
-                       case 500: return "Internal Server Error";
-                       case 501: return "Not Implemented";
-                       case 502: return "Bad Gateway";
-                       case 503: return "Service Unavailable";
-                       case 504: return "Gateway Timeout";
-                       case 505: return "Http Version Not Supported";
-                       case 507: return "Insufficient Storage";
-                       }
-                       return "";
-               }
-       }
 }
 #endif
 
diff --git a/mcs/class/System/System.Net/HttpListenerResponse.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListenerResponse.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..97661d6
--- /dev/null
@@ -0,0 +1,150 @@
+//
+// System.Net.HttpListenerResponse
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.IO;
+using System.Text;
+
+namespace System.Net {
+       public sealed class HttpListenerResponse : IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.HttpListenerResponse is not supported on the current platform.";
+
+               HttpListenerResponse ()
+               {
+               }
+
+               public Encoding ContentEncoding {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public long ContentLength64 {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string ContentType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public CookieCollection Cookies {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public WebHeaderCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool KeepAlive {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Stream OutputStream {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Version ProtocolVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string RedirectLocation {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool SendChunked {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int StatusCode {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string StatusDescription {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               void IDisposable.Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Abort ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddHeader (string name, string value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AppendCookie (Cookie cookie)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AppendHeader (string name, string value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Close (byte [] responseEntity, bool willBlock)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void CopyFrom (HttpListenerResponse templateResponse)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Redirect (string url)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void SetCookie (Cookie cookie)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net/HttpListenerResponseHelper.cs b/mcs/class/System/System.Net/HttpListenerResponseHelper.cs
new file mode 100644 (file)
index 0000000..7fc3c11
--- /dev/null
@@ -0,0 +1,88 @@
+//
+// System.Net.HttpListenerResponseHelper
+//
+// Author:
+//     Gonzalo Paniagua Javier (gonzalo@novell.com)
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+// Copyright (C) 2016 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 {
+       // do not inline into HttpListenerResponse as this recursively brings everything that's
+       // reachable by IDisposable.Dispose (and that's quite a lot in this case).
+       static class HttpListenerResponseHelper {
+
+               internal static string GetStatusDescription (int code)
+               {
+                       switch (code){
+                       case 100: return "Continue";
+                       case 101: return "Switching Protocols";
+                       case 102: return "Processing";
+                       case 200: return "OK";
+                       case 201: return "Created";
+                       case 202: return "Accepted";
+                       case 203: return "Non-Authoritative Information";
+                       case 204: return "No Content";
+                       case 205: return "Reset Content";
+                       case 206: return "Partial Content";
+                       case 207: return "Multi-Status";
+                       case 300: return "Multiple Choices";
+                       case 301: return "Moved Permanently";
+                       case 302: return "Found";
+                       case 303: return "See Other";
+                       case 304: return "Not Modified";
+                       case 305: return "Use Proxy";
+                       case 307: return "Temporary Redirect";
+                       case 400: return "Bad Request";
+                       case 401: return "Unauthorized";
+                       case 402: return "Payment Required";
+                       case 403: return "Forbidden";
+                       case 404: return "Not Found";
+                       case 405: return "Method Not Allowed";
+                       case 406: return "Not Acceptable";
+                       case 407: return "Proxy Authentication Required";
+                       case 408: return "Request Timeout";
+                       case 409: return "Conflict";
+                       case 410: return "Gone";
+                       case 411: return "Length Required";
+                       case 412: return "Precondition Failed";
+                       case 413: return "Request Entity Too Large";
+                       case 414: return "Request-Uri Too Long";
+                       case 415: return "Unsupported Media Type";
+                       case 416: return "Requested Range Not Satisfiable";
+                       case 417: return "Expectation Failed";
+                       case 422: return "Unprocessable Entity";
+                       case 423: return "Locked";
+                       case 424: return "Failed Dependency";
+                       case 500: return "Internal Server Error";
+                       case 501: return "Not Implemented";
+                       case 502: return "Bad Gateway";
+                       case 503: return "Service Unavailable";
+                       case 504: return "Gateway Timeout";
+                       case 505: return "Http Version Not Supported";
+                       case 507: return "Insufficient Storage";
+                       }
+                       return "";
+               }
+       }
+}
index d7e008baa0303d99aeb1635e613cb7c990a2b054..34673579632d3810fa69491483a2ac33e83155f1 100644 (file)
@@ -30,6 +30,46 @@ namespace System.Net
 {
        public class HttpListenerTimeoutManager
        {
+               [MonoTODO]
+               public TimeSpan EntityBody
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
 
+               [MonoTODO]
+               public TimeSpan DrainEntityBody
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+
+               [MonoTODO]
+               public TimeSpan RequestQueue
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+
+               [MonoTODO]
+               public TimeSpan IdleConnection
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+
+               [MonoTODO]
+               public TimeSpan HeaderWait
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+
+               [MonoTODO]
+               public long MinSendBytesPerSecond
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
        }
 }
\ No newline at end of file
index 9f94783258dfa6a4067bebd666584507334cfd6c..1d48dfe0b87af4f3729fa0b14caf4dc9558ab373 100644 (file)
@@ -226,12 +226,12 @@ namespace System.Net
                        internal set { actualUri = value; } // Used by Ftp+proxy
                }
                
-               public bool AllowAutoRedirect {
+               public virtual bool AllowAutoRedirect {
                        get { return allowAutoRedirect; }
                        set { this.allowAutoRedirect = value; }
                }
                
-               public bool AllowWriteStreamBuffering {
+               public virtual bool AllowWriteStreamBuffering {
                        get { return allowBuffering; }
                        set { allowBuffering = value; }
                }
@@ -918,6 +918,12 @@ namespace System.Net
                        return EndGetRequestStream (asyncResult);
                }
 
+               [MonoTODO]
+               public Stream GetRequestStream (out TransportContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
                bool CheckIfForceWrite (SimpleAsyncResult result)
                {
                        if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
diff --git a/mcs/class/System/System.Net/HttpWebRequest.platformnotsupported.cs b/mcs/class/System/System.Net/HttpWebRequest.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..5fc0164
--- /dev/null
@@ -0,0 +1,460 @@
+//
+// System.Net.HttpWebRequest
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.IO;
+using System.Net.Security;
+using System.Runtime.Serialization;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.Net
+{
+       [Serializable]
+       public class HttpWebRequest : WebRequest, ISerializable
+       {
+               internal const string EXCEPTION_MESSAGE = "System.Net.HttpWebRequest is not supported on the current platform.";
+
+               internal WebConnection WebConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+#if MOBILE
+               public
+#else
+               internal
+#endif
+               HttpWebRequest (Uri uri)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal HttpWebRequest (Uri uri, object /* IMonoTlsProvider */ tlsProvider, object /* MonoTlsSettings */ settings = null)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public string Accept {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Uri Address {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool AllowAutoRedirect {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool AllowWriteStreamBuffering {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool AllowReadStreamBuffering {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DecompressionMethods AutomaticDecompression {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal bool InternalAllowBuffering {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal Mono.Net.Security.IMonoTlsProvider TlsProvider {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal Mono.Security.Interface.MonoTlsSettings TlsSettings {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public X509CertificateCollection ClientCertificates {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Connection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ConnectionGroupName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override long ContentLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal long InternalContentLength {
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ContentType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public HttpContinueDelegate ContinueDelegate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual CookieContainer CookieContainer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override ICredentials Credentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DateTime Date {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+#if !MOBILE
+               public static new RequestCachePolicy DefaultCachePolicy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+#endif
+
+               public static int DefaultMaximumErrorResponseLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Expect {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool HaveResponse {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebHeaderCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Host {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DateTime IfModifiedSince {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool KeepAlive {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaximumAutomaticRedirections {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaximumResponseHeadersLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static int DefaultMaximumResponseHeadersLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ReadWriteTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ContinueTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string MediaType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string Method {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool Pipelined {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool PreAuthenticate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Version ProtocolVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override IWebProxy Proxy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Referer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override Uri RequestUri {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool SendChunked {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ServicePoint ServicePoint {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal ServicePoint ServicePointNoLock {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool SupportsCookieContainer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int Timeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string TransferEncoding {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool UseDefaultCredentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string UserAgent {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UnsafeAuthenticatedConnectionSharing {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal bool ExpectContinue {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal ServerCertValidationCallback ServerCertValidationCallback {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal Uri AuthUri {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void AddRange (int range)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (int from, int to)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (string rangeSpecifier, int range)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (string rangeSpecifier, int from, int to)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (long range)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (long from, long to)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (string rangeSpecifier, long range)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (string rangeSpecifier, long from, long to)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream EndGetRequestStream (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream GetRequestStream()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override WebResponse EndGetResponse (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override WebResponse GetResponse()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal bool FinishedReading {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal bool Aborted {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override void Abort ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void DoContinueDelegate (int statusCode, WebHeaderCollection headers)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal byte[] GetRequestHeaders ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void SetWriteStream (WebConnectionStream stream)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void SetResponseData (WebConnectionData data)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void SetResponseError (WebExceptionStatus status, Exception e, string where)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal bool ReuseConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               internal WebConnection StoredConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
index 6a73ae0f167c2b5217a06293eb2f90d54b370e5b..9f7daa6c4523b2b5b3e9ef6585d0d19b7d5602d5 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Net
                        version = (Version) info.GetValue ("version", typeof (Version));
                        statusCode = (HttpStatusCode) info.GetValue ("statusCode", typeof (HttpStatusCode));
                }
-               
+
                // Properties
                
                public string CharacterSet {
diff --git a/mcs/class/System/System.Net/HttpWebResponse.platformnotsupported.cs b/mcs/class/System/System.Net/HttpWebResponse.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..300d5d4
--- /dev/null
@@ -0,0 +1,147 @@
+//
+// System.Net.HttpWebResponse
+//
+// Author:
+//     Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (C) 2016 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.
+//
+
+using System.IO;
+using System.Runtime.Serialization;
+
+namespace System.Net
+{
+       [Serializable]
+       public class HttpWebResponse : WebResponse, ISerializable, IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.HttpWebResponse is not supported on the current platform.";
+
+               [Obsolete ("Serialization is obsoleted for this type", false)]
+               protected HttpWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public string CharacterSet {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string ContentEncoding {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override long ContentLength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ContentType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual CookieCollection Cookies {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override WebHeaderCollection Headers {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               [MonoTODO]
+               public override bool IsMutuallyAuthenticated {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DateTime LastModified {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual string Method {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Version ProtocolVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override Uri ResponseUri {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Server {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual HttpStatusCode StatusCode {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual string StatusDescription {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool SupportsHeaders {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string GetResponseHeader (string headerName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               internal void ReadAll ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream GetResponseStream ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               void IDisposable.Dispose ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 17308253af502c5f6d2c134ba11acb2a0e4be2c8..d379526e80b9cb0510bd1619ad782d4d339d5fa3 100644 (file)
@@ -256,6 +256,12 @@ namespace System.Net
                        }
                }
 
+               [MonoTODO]
+               public static bool ReusePort {
+                       get { return false; }
+                       set { throw new NotImplementedException (); }
+               }
+
                public static SecurityProtocolType SecurityProtocol {
                        get { return _securityProtocol; }
                        set { _securityProtocol = value; }
@@ -280,6 +286,13 @@ namespace System.Net
                        }
                }
 
+               [MonoTODO ("Always returns EncryptionPolicy.RequireEncryption.")]
+               public static EncryptionPolicy EncryptionPolicy {
+                       get {
+                               return EncryptionPolicy.RequireEncryption;
+                       }
+               }
+
                public static bool Expect100Continue {
                        get { return expectContinue; }
                        set { expectContinue = value; }
diff --git a/mcs/class/System/System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs b/mcs/class/System/System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
deleted file mode 100644 (file)
index 3fa9b3f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ServiceNameCollection.cs
-//
-// Authors:
-//      Atsushi Enomoto  <atsushi@ximian.com>
-//
-
-//
-// Copyright (C) 2010 Novell, Inc (http://novell.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.
-//
-using System;
-using System.Collections;
-
-namespace System.Security.Authentication.ExtendedProtection
-{
-       [MonoTODO]
-       [Serializable]
-       public class ServiceNameCollection : ReadOnlyCollectionBase
-       {
-               public ServiceNameCollection (ICollection items)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public ServiceNameCollection Merge (IEnumerable serviceNames)
-               {
-                       throw new NotImplementedException ();
-               }
-               
-               public ServiceNameCollection Merge (string serviceName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public bool Contains (string searchServiceName)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
-
index 29decab439faa252aeb371c167e754684e7f9ec9..bd69c786b89b80f947a56046fa9d7eb45411e291 100644 (file)
@@ -45,6 +45,7 @@ using MX = Mono.Security.X509;
 using System.IO;
 using System.Text;
 using System.Collections;
+using System.Runtime.Serialization;
 
 namespace System.Security.Cryptography.X509Certificates {
 
@@ -134,6 +135,10 @@ namespace System.Security.Cryptography.X509Certificates {
                {
                }
 
+               protected X509Certificate2 (SerializationInfo info, StreamingContext context) : base (info, context)
+               {
+               }
+
                internal X509Certificate2 (X509Certificate2Impl impl)
                        : base (impl)
                {
index 92e3b3e84c0c38b65ed9cb2625ec93b911860d86..26e65f5a13553ed5e4b1da373323f9c4cf51add8 100644 (file)
@@ -148,11 +148,9 @@ System.Diagnostics/PerformanceCounterPermissionEntryCollection.cs
 System.Diagnostics/PerformanceCounterPermissionEntry.cs
 System.Diagnostics/PerformanceCounterType.cs
 System.Diagnostics/Process.cs
-System.Diagnostics/ProcessModuleCollection.cs
 System.Diagnostics/ProcessModule.cs
 System.Diagnostics/ProcessPriorityClass.cs
 System.Diagnostics/ProcessStartInfo.cs
-System.Diagnostics/ProcessThreadCollection.cs
 System.Diagnostics/ProcessThread.cs
 System.Diagnostics/ProcessWindowStyle.cs
 System.Diagnostics/Stopwatch.cs
@@ -271,6 +269,7 @@ System.Net/HttpListener.cs
 System.Net/HttpListenerPrefixCollection.cs
 System.Net/HttpListenerRequest.cs
 System.Net/HttpListenerResponse.cs
+System.Net/HttpListenerResponseHelper.cs
 System.Net/HttpListenerTimeoutManager.cs
 System.Net/HttpRequestCreator.cs
 System.Net/HttpStreamAsyncResult.cs
@@ -387,6 +386,7 @@ System.Net.Sockets/SafeSocketHandle.cs
 ../referencesource/System/net/System/Net/Sockets/SelectMode.cs
 System.Net.Sockets/SendPacketsElement.cs
 System.Net.Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
 System.Net.Sockets/SocketAsyncResult.cs
@@ -437,7 +437,6 @@ System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicy.cs
 System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs
 System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs
 System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs
-System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs
@@ -973,6 +972,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/_ProxyChain.cs
 ../referencesource/System/net/System/Net/_ScatterGatherBuffers.cs
 ../referencesource/System/net/System/Net/_Semaphore.cs
+../referencesource/System/net/System/Net/_ServiceNameStore.cs
 ../referencesource/System/net/System/Net/_TimerThread.cs
 ../referencesource/System/net/System/Net/_WebProxyDataBuilder.cs
 ../referencesource/System/net/System/Net/AuthenticationScheme.cs
@@ -1096,6 +1096,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
 
 ../referencesource/System/security/system/security/Authentication/ExtendedProtection/TokenBinding.cs
+../referencesource/System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
 
 ../referencesource/System/security/system/security/cryptography/oid.cs
 
@@ -1103,6 +1104,9 @@ ReferenceSources/Win32Exception.cs
 
 ../referencesource/System/security/system/security/permissions/typedescriptorpermission.cs
 
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
+
 ../referencesource/System/services/timers/system/timers/ElapsedEventHandler.cs
 ../referencesource/System/services/timers/system/timers/Timer.cs
 ../referencesource/System/services/timers/system/timers/TimersDescriptionAttribute.cs
index 909beb4988c8873dc7a6cd85d2b383443f1b290a..8c163f77b02be58b6b816e1d50f28c4b23b4eee6 100644 (file)
@@ -16,16 +16,15 @@ using System.Threading;
 namespace MonoTests.System.Net.Mail
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class SmtpClientTest
        {
-               SmtpClient smtp;
+               SmtpClient _smtp;
+               SmtpClient smtp { get { return _smtp ?? (_smtp = new SmtpClient ()); } }
                string tempFolder;
                
                [SetUp]
                public void GetReady ()
                {
-                       smtp = new SmtpClient ();
                        tempFolder = Path.Combine (Path.GetTempPath (), this.GetType ().FullName);
                        if (Directory.Exists (tempFolder))
                                Directory.Delete (tempFolder, true);
@@ -40,12 +39,18 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Credentials_Default ()
                {
                        Assert.IsNull (smtp.Credentials);
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DeliveryMethod ()
                {
                        Assert.AreEqual (SmtpDeliveryMethod.Network, smtp.DeliveryMethod, "#1");
@@ -61,6 +66,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void EnableSsl ()
                {
                        Assert.IsFalse (smtp.EnableSsl, "#1");
@@ -71,6 +79,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Host ()
                {
                        smtp.Host = "127.0.0.1";
@@ -87,6 +98,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Host_Value_Null ()
                {
                        try {
@@ -101,6 +115,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Host_Value_Empty ()
                {
                        try {
@@ -116,6 +133,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PickupDirectoryLocation ()
                {
                        Assert.IsNull (smtp.PickupDirectoryLocation, "#1");
@@ -132,6 +152,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Port ()
                {
                        Assert.AreEqual (25, smtp.Port, "#1");
@@ -142,6 +165,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Port_Value_Invalid ()
                {
                        // zero
@@ -168,6 +194,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Message_Null ()
                {
                        try {
@@ -182,6 +211,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Network_Host_Null ()
                {
                        try {
@@ -197,6 +229,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_Network_Host_Whitespace ()
                {
                        smtp.Host = " \r\n ";
@@ -213,6 +248,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory ()
                {
                        smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
@@ -226,6 +264,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_DirectoryNotFound ()
                {
                        Directory.Delete (tempFolder);
@@ -253,6 +294,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Empty ()
                {
                        smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
@@ -272,6 +316,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_IllegalChars ()
                {
                        smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
@@ -297,6 +344,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_NotAbsolute ()
                {
                        smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
@@ -316,6 +366,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Null ()
                {
                        smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
@@ -334,6 +387,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Timeout ()
                {
                        Assert.AreEqual (100000, smtp.Timeout, "#1");
@@ -344,19 +400,29 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentOutOfRangeException))]
+#endif
                public void Timeout_Value_Negative ()
                {
                        smtp.Timeout = -1;
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UseDefaultCredentials_Default ()
                {
                        Assert.IsFalse (smtp.UseDefaultCredentials);
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Deliver ()
                {
                        var server = new SmtpServer ();
@@ -373,6 +439,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Deliver_Envelope ()
                {
                        var server = new SmtpServer ();
@@ -391,6 +460,9 @@ namespace MonoTests.System.Net.Mail
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Deliver_Async ()
                {
                        // SmtpClient uses BackgroundWorker and listens for the RunWorkerCompleted
index e5c70feab2c16b07d69d2a241697eea1f0d06220..e3542c34f37428c53bfd338e59b298a0909ff60a 100644 (file)
@@ -45,7 +45,6 @@ namespace MonoTests.System.Net.Security
 {
 
 [TestFixture]
-[Category ("RequiresBSDSockets")]
 public class SslStreamTest {
 
        byte[] m_serverCertRaw = { 48, 130, 5, 165, 2, 1, 3, 48, 130, 5, 95, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 5, 80, 4, 130, 5, 76, 48, 130, 5, 72, 48, 130, 2, 87, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 6, 160, 130, 2, 72, 48, 130, 2, 68, 2, 1, 0, 48, 130, 2, 61, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 211, 176, 234, 3, 252, 26, 32, 15, 2, 2, 7, 208, 128, 130, 2, 16, 183, 149, 35, 180, 127, 95, 163, 122, 138, 244, 29, 177, 220, 173, 46, 73, 208, 217, 211, 190, 164, 183, 21, 110, 33, 122, 98, 163, 251, 16, 23, 106, 154, 14, 52, 177, 3, 12, 248, 226, 48, 123, 211, 6, 216, 6, 192, 175, 203, 142, 141, 143, 252, 178, 7, 162, 81, 232, 159, 42, 56, 177, 191, 53, 7, 146, 189, 236, 75, 140, 210, 143, 11, 103, 64, 58, 10, 73, 123, 39, 97, 119, 166, 114, 123, 65, 68, 214, 42, 17, 156, 122, 8, 58, 184, 134, 255, 48, 64, 20, 229, 247, 196, 12, 130, 56, 176, 69, 179, 254, 216, 45, 25, 244, 240, 116, 88, 137, 66, 13, 18, 202, 199, 59, 200, 245, 19, 175, 232, 217, 211, 12, 191, 222, 26, 162, 253, 73, 201, 48, 61, 3, 248, 117, 16, 71, 233, 183, 90, 110, 91, 116, 56, 133, 223, 148, 19, 78, 140, 123, 159, 203, 78, 15, 172, 39, 190, 39, 71, 180, 155, 48, 156, 116, 212, 52, 1, 231, 201, 196, 73, 87, 68, 104, 208, 40, 104, 32, 218, 235, 245, 84, 136, 168, 51, 9, 93, 126, 46, 80, 180, 240, 144, 79, 88, 87, 159, 24, 108, 186, 9, 20, 48, 100, 148, 250, 4, 163, 115, 131, 44, 13, 38, 222, 117, 196, 196, 128, 114, 149, 97, 93, 37, 191, 3, 192, 231, 88, 80, 218, 147, 8, 192, 165, 27, 206, 56, 42, 157, 230, 223, 130, 253, 169, 182, 245, 192, 181, 18, 212, 133, 168, 73, 92, 66, 197, 117, 245, 107, 127, 23, 146, 249, 41, 66, 219, 210, 207, 221, 205, 205, 15, 110, 92, 12, 207, 76, 239, 4, 13, 129, 127, 170, 205, 253, 148, 208, 24, 129, 24, 210, 220, 85, 45, 179, 137, 66, 134, 142, 22, 112, 48, 160, 236, 232, 38, 83, 101, 55, 51, 18, 110, 99, 69, 41, 173, 107, 233, 11, 199, 23, 61, 135, 222, 94, 74, 29, 219, 80, 128, 167, 186, 254, 235, 42, 96, 134, 5, 13, 90, 59, 231, 137, 195, 207, 28, 165, 12, 218, 5, 72, 102, 61, 135, 198, 73, 250, 97, 89, 214, 179, 244, 194, 23, 142, 157, 4, 243, 90, 69, 54, 10, 139, 76, 95, 40, 225, 219, 59, 15, 54, 182, 206, 142, 228, 248, 79, 156, 129, 246, 63, 6, 6, 236, 44, 67, 116, 213, 170, 47, 193, 186, 139, 25, 80, 166, 57, 99, 231, 156, 191, 117, 65, 76, 7, 243, 244, 127, 225, 210, 190, 164, 141, 46, 36, 99, 111, 203, 133, 127, 80, 28, 61, 160, 36, 132, 182, 16, 41, 39, 185, 232, 123, 32, 57, 189, 100, 152, 38, 205, 5, 189, 240, 65, 3, 191, 73, 85, 12, 209, 180, 1, 194, 70, 124, 57, 71, 48, 230, 235, 122, 175, 157, 35, 233, 83, 40, 20, 169, 224, 14, 11, 216, 48, 194, 105, 25, 187, 210, 182, 6, 184, 73, 95, 85, 210, 227, 113, 58, 10, 186, 175, 254, 25, 102, 39, 3, 2, 200, 194, 197, 200, 224, 77, 164, 8, 36, 114, 48, 130, 2, 233, 6, 9, 42, 134, 72, 134, 247, 13, 1, 7, 1, 160, 130, 2, 218, 4, 130, 2, 214, 48, 130, 2, 210, 48, 130, 2, 206, 6, 11, 42, 134, 72, 134, 247, 13, 1, 12, 10, 1, 2, 160, 130, 2, 166, 48, 130, 2, 162, 48, 28, 6, 10, 42, 134, 72, 134, 247, 13, 1, 12, 1, 3, 48, 14, 4, 8, 178, 13, 52, 135, 85, 49, 79, 105, 2, 2, 7, 208, 4, 130, 2, 128, 21, 84, 227, 109, 230, 144, 140, 170, 117, 250, 179, 207, 129, 100, 126, 126, 29, 231, 94, 140, 45, 26, 168, 45, 240, 4, 170, 73, 98, 115, 109, 96, 177, 206, 6, 80, 170, 22, 237, 144, 58, 95, 59, 26, 85, 135, 178, 69, 184, 44, 122, 81, 213, 135, 149, 198, 246, 83, 68, 129, 2, 186, 118, 33, 44, 214, 227, 240, 220, 51, 175, 220, 220, 180, 113, 216, 101, 138, 81, 54, 38, 0, 216, 30, 29, 187, 213, 230, 12, 181, 130, 21, 241, 98, 120, 41, 150, 176, 69, 37, 169, 249, 123, 212, 254, 135, 154, 214, 127, 39, 105, 149, 180, 218, 41, 207, 75, 70, 105, 169, 185, 169, 132, 173, 188, 82, 251, 71, 234, 136, 5, 254, 110, 223, 34, 4, 145, 7, 19, 51, 123, 140, 75, 226, 0, 21, 220, 228, 223, 218, 8, 169, 210, 194, 139, 93, 218, 55, 40, 174, 50, 238, 38, 166, 222, 103, 0, 209, 88, 131, 51, 222, 154, 217, 18, 172, 73, 17, 133, 54, 173, 208, 118, 104, 167, 113, 153, 223, 251, 154, 120, 176, 18, 127, 51, 206, 164, 77, 86, 9, 82, 212, 86, 162, 206, 230, 79, 217, 178, 42, 217, 162, 152, 188, 217, 59, 212, 117, 200, 135, 75, 74, 43, 1, 42, 79, 180, 164, 250, 122, 103, 103, 157, 11, 14, 33, 48, 8, 108, 155, 46, 124, 223, 204, 169, 124, 104, 11, 246, 213, 226, 16, 125, 17, 228, 15, 178, 141, 79, 78, 115, 76, 131, 122, 166, 124, 154, 1, 174, 178, 176, 213, 208, 188, 71, 118, 220, 168, 64, 218, 176, 134, 38, 229, 14, 109, 162, 125, 16, 57, 249, 201, 180, 17, 182, 143, 184, 12, 248, 113, 65, 70, 109, 79, 249, 34, 170, 35, 228, 219, 121, 202, 228, 121, 127, 255, 22, 173, 202, 171, 33, 232, 4, 240, 142, 216, 80, 56, 177, 83, 93, 123, 217, 213, 157, 99, 34, 194, 61, 228, 239, 194, 20, 27, 9, 53, 132, 79, 19, 97, 107, 31, 51, 39, 176, 223, 90, 88, 67, 138, 194, 169, 176, 144, 202, 119, 146, 74, 27, 118, 63, 129, 230, 101, 104, 75, 116, 49, 223, 254, 225, 70, 206, 183, 11, 134, 148, 10, 55, 57, 50, 178, 144, 164, 139, 233, 169, 109, 186, 211, 95, 123, 75, 111, 192, 187, 127, 240, 45, 226, 194, 240, 128, 10, 79, 178, 192, 66, 21, 197, 24, 171, 141, 255, 185, 230, 84, 206, 151, 9, 93, 115, 162, 12, 115, 129, 218, 103, 219, 183, 142, 123, 3, 110, 139, 208, 4, 146, 76, 99, 246, 240, 32, 169, 148, 16, 146, 172, 230, 36, 56, 145, 23, 94, 209, 92, 38, 244, 127, 70, 121, 253, 66, 55, 36, 140, 98, 105, 233, 112, 24, 23, 230, 112, 62, 244, 12, 48, 30, 51, 0, 18, 244, 139, 66, 245, 234, 203, 195, 52, 119, 255, 84, 82, 204, 100, 176, 167, 24, 224, 8, 127, 214, 148, 115, 242, 56, 190, 72, 221, 68, 252, 36, 74, 254, 57, 52, 96, 20, 173, 32, 236, 87, 15, 16, 76, 9, 48, 3, 61, 2, 137, 137, 9, 68, 213, 99, 163, 63, 201, 83, 241, 98, 7, 117, 108, 4, 123, 170, 18, 10, 19, 198, 31, 170, 15, 247, 216, 145, 172, 239, 137, 181, 80, 160, 24, 11, 35, 131, 58, 218, 22, 250, 215, 52, 160, 246, 197, 183, 92, 137, 0, 245, 63, 49, 183, 246, 195, 58, 63, 4, 75, 10, 92, 131, 181, 59, 78, 247, 44, 150, 49, 49, 107, 211, 62, 71, 62, 222, 159, 161, 118, 236, 55, 219, 49, 0, 3, 82, 236, 96, 20, 83, 39, 245, 208, 240, 245, 174, 218, 49, 21, 48, 19, 6, 9, 42, 134, 72, 134, 247, 13, 1, 9, 21, 49, 6, 4, 4, 1, 0, 0, 0, 48, 61, 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 30, 154, 48, 126, 198, 239, 114, 62, 12, 58, 129, 172, 67, 156, 76, 214, 62, 205, 89, 28, 4, 20, 135, 177, 105, 83, 79, 93, 181, 149, 169, 49, 112, 201, 70, 212, 153, 79, 198, 163, 137, 90, 2, 2, 7, 208 };
@@ -60,6 +59,9 @@ public class SslStreamTest {
        }
 
        [Test] //bug https://bugzilla.novell.com/show_bug.cgi?id=457120
+#if FEATURE_NO_BSD_SOCKETS
+       [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
        public void AuthenticateClientAndServer_ClientSendsNoData ()
        {
                AuthenticateClientAndServer (true, true);
index e51f2d9b7d526e14185622f3337904180ebd89a9..0af239d238ccd494056a4fb8476cd8d1e356f1c4 100644 (file)
@@ -16,12 +16,16 @@ using NUnit.Framework;
 namespace MonoTests.System.Net.Sockets
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class NetworkStreamTest
        {
                [Test]
                // See bug #371923
+
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException(typeof(IOException))]
+#endif
                public void NetworkStreamConnection ()
                {
                        IPEndPoint ipe = new IPEndPoint(Dns.GetHostEntry ("www.google.com").AddressList [0], 80);
@@ -31,6 +35,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadTimeout ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
index 28bc6bb81745f29059c186633126c3addaabfa9a..cc2d8249fd3a63a57d8ab4713b8fc012235d4d78 100644 (file)
@@ -6,10 +6,12 @@ using NUnit.Framework;
 namespace MonoTests.System.Net.Sockets
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class SocketAcceptAsyncTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AcceptAsyncShouldUseAcceptSocketFromEventArgs()
                {
                        var readyEvent = new ManualResetEvent(false);
@@ -19,27 +21,41 @@ namespace MonoTests.System.Net.Sockets
                        var serverSocket = new Socket(
                                        AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                        Socket acceptedSocket = null;
-
+                       Exception ex = null;
                        ThreadPool.QueueUserWorkItem(_ =>
                        {
-                               listenSocket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
-                               listenSocket.Listen(1);
-
-                               var asyncEventArgs = new SocketAsyncEventArgs {AcceptSocket = serverSocket};
-                               asyncEventArgs.Completed += (s, e) =>
-                               {
-                                       acceptedSocket = e.AcceptSocket;
-                                       mainEvent.Set();
-                               };
+                               SocketAsyncEventArgs asyncEventArgs;
+                               try {
+                                       listenSocket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
+                                       listenSocket.Listen(1);
 
-                               readyEvent.Set();
+                                       asyncEventArgs = new SocketAsyncEventArgs {AcceptSocket = serverSocket};
+                                       asyncEventArgs.Completed += (s, e) =>
+                                       {
+                                               acceptedSocket = e.AcceptSocket;
+                                               mainEvent.Set();
+                                       };
 
-                               if (listenSocket.AcceptAsync(asyncEventArgs))
+                               } catch (Exception e) {
+                                       ex = e;
                                        return;
-                               acceptedSocket = asyncEventArgs.AcceptSocket;
-                               mainEvent.Set();
+                               } finally {
+                                       readyEvent.Set();
+                               }
+
+                               try {
+                                       if (listenSocket.AcceptAsync(asyncEventArgs))
+                                               return;
+                                       acceptedSocket = asyncEventArgs.AcceptSocket;
+                               } catch (Exception e) {
+                                       ex = e;
+                               } finally {
+                                       mainEvent.Set();
+                               }
                        });
                        Assert.IsTrue(readyEvent.WaitOne(1500));
+                       if (ex != null)
+                               throw ex;
 
                        var clientSocket = new Socket(
                                AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
index d286668707e437635c1bc4e3920b45b4d2fa7072..df31233d68fbd429825cac9d877e9029fb7c9e57 100644 (file)
@@ -8,7 +8,6 @@ using NUnit.Framework;
 namespace MonoTests.System.Net.Sockets
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class SocketAsyncTest
        {
                Socket serverSocket;
@@ -17,8 +16,7 @@ namespace MonoTests.System.Net.Sockets
                ManualResetEvent mainEvent;
                Exception error;
 
-               [TestFixtureSetUp]
-               public void SetUp ()
+               void SetUp ()
                {
                        readyEvent = new ManualResetEvent (false);
                        mainEvent = new ManualResetEvent (false);
@@ -26,6 +24,9 @@ namespace MonoTests.System.Net.Sockets
                        ThreadPool.QueueUserWorkItem (_ => DoWork ());
                        readyEvent.WaitOne ();
 
+                       if (error != null)
+                               throw error;
+
                        clientSocket = new Socket (
                                AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                        clientSocket.Connect (serverSocket.LocalEndPoint);
@@ -43,18 +44,22 @@ namespace MonoTests.System.Net.Sockets
 
                void DoWork ()
                {
-                       serverSocket = new Socket (
-                               AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                       serverSocket.Bind (new IPEndPoint (IPAddress.Loopback, 0));
-                       serverSocket.Listen (1);
-
-                       var async = new SocketAsyncEventArgs ();
-                       async.Completed += (s,e) => OnAccepted (e);
-
-                       readyEvent.Set ();
-
-                       if (!serverSocket.AcceptAsync (async))
-                               OnAccepted (async);
+                       try {
+                               serverSocket = new Socket (
+                                       AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                               serverSocket.Bind (new IPEndPoint (IPAddress.Loopback, 0));
+                               serverSocket.Listen (1);
+
+                               var async = new SocketAsyncEventArgs ();
+                               async.Completed += (s,e) => OnAccepted (e);
+
+                               if (!serverSocket.AcceptAsync (async))
+                                       OnAccepted (async);
+                       } catch (Exception e) {
+                               error = e;
+                       } finally {
+                               readyEvent.Set ();
+                       }
                }
 
                void OnAccepted (SocketAsyncEventArgs e)
@@ -93,8 +98,12 @@ namespace MonoTests.System.Net.Sockets
 
                [Test]
                [Category("Test")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SendAsync ()
                {
+                       SetUp ();
                        var buffer = new byte [] { 0x12, 0x34, 0x56, 0x78 };
                        var m = new ManualResetEvent (false);
                        var e = new SocketAsyncEventArgs ();
index 5045dab173f6b8439ff24acfaf27e066f32897bd..58c1c5c5a3c263d177645380b69b75f1944b1272 100755 (executable)
@@ -28,7 +28,6 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net.Sockets
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class SocketTest
        {
                // note: also used in SocketCas tests
@@ -36,6 +35,9 @@ namespace MonoTests.System.Net.Sockets
                public const int BogusPort = 23483;
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectIPAddressAny ()
                {
                        IPEndPoint ep = new IPEndPoint (IPAddress.Any, NetworkHelpers.FindFreePort ());
@@ -86,6 +88,9 @@ namespace MonoTests.System.Net.Sockets
 
                [Test]
                [Category ("InetAccess")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BogusEndConnect ()
                {
                        IPAddress ipOne = IPAddress.Parse (BogusAddress);
@@ -156,6 +161,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AcceptBlockingStatus()
                {
                        bool block;
@@ -200,6 +208,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectFailAsync ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -222,6 +233,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOptionBoolean ()
                {
                        IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, NetworkHelpers.FindFreePort ());
@@ -233,6 +247,9 @@ namespace MonoTests.System.Net.Sockets
                        }
                }
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestSelect1 ()
                {
                        Socket srv = CreateServer (NetworkHelpers.FindFreePort ());
@@ -370,7 +387,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed19 ()
                {
                        Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@@ -381,7 +402,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed20 ()
                {
                        Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@@ -392,7 +417,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed21 ()
                {
                        Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@@ -403,7 +432,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed22 ()
                {
                        Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@@ -424,6 +457,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetHashCodeTest ()
                {
                        Socket server = new Socket (AddressFamily.InterNetwork,
@@ -459,6 +495,7 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+               [Category ("RequiresBSDSockets")] // This verifies particular error codes, which we don't care about when nothing's working anyway.
                public void SocketErrorTest ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -700,6 +737,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void IsBoundTcp ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -732,6 +772,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void IsBoundUdp ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1304,7 +1347,11 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(InvalidOperationException))]
+#endif
                public void BeginAcceptNotListening ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1319,6 +1366,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAccept ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1386,6 +1436,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAcceptData ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1450,6 +1503,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAcceptSocketUdp ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1477,6 +1533,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAcceptSocketBound ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1508,6 +1567,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAcceptSocket ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1589,6 +1651,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginAcceptSocketAccClosed ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1638,6 +1703,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectAddressPort ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1687,6 +1755,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectAddressPortListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1781,6 +1852,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectMultiple2 ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1853,6 +1927,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectMultipleListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1917,6 +1994,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectHostPortListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -1984,6 +2064,9 @@ namespace MonoTests.System.Net.Sockets
                
                [Test]
                [Category ("NotDotNet")] // "Needs XP or later"
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginDisconnect ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2080,6 +2163,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BindTwice ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2103,6 +2189,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Close ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2131,6 +2220,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectAddressPort ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2171,6 +2263,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectAddressPortListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2257,6 +2352,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectMultiple2 ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2314,6 +2412,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectMultipleListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2376,6 +2477,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectHostPortListen ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2414,7 +2518,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ObjectDisposedException))]
+#endif
                public void ConnectHostPortClosed ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2428,6 +2536,9 @@ namespace MonoTests.System.Net.Sockets
                
                [Test]
                [Category ("NotDotNet")] // "Needs XP or later"
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Disconnect ()
                {
                        Socket sock = new Socket (AddressFamily.InterNetwork,
@@ -2485,6 +2596,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveGeneric ()
                {
                        int i;
@@ -2542,6 +2656,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SendGeneric ()
                {
                        int i;
@@ -2646,14 +2763,14 @@ namespace MonoTests.System.Net.Sockets
                                byte[] buffer = new byte[256];
                                while (totalReceived < sendbuf.Length) {
                                        int recvd = clientsock.Receive (buffer, 0, buffer.Length, SocketFlags.None);
-                                       buffer.CopyTo (recvbuf, totalReceived);
+                                       Array.Copy (buffer, 0, recvbuf, totalReceived, recvd);
                                        totalReceived += recvd;
                                }
 
                                Assert.AreEqual (BUFFER_SIZE, totalReceived, "#2");
                        });
 
-                       Task.WaitAll (new []{sendTask, recvTask});
+                       Assert.IsTrue (Task.WaitAll (new []{sendTask, recvTask}, 15 * 1000), "#2a");
 
                        for (i = 0; i < BUFFER_SIZE; i++) {
                                Assert.AreEqual (recvbuf[i], sendbuf[i],
@@ -2700,6 +2817,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseWhileReceiving ()
                {
                        CWRSocket = new Socket (AddressFamily.InterNetwork,
@@ -3069,6 +3189,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom1_Buffer_Null ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3110,6 +3233,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom1_Socket_Closed ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3130,6 +3256,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom2_Buffer_Null ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3171,6 +3300,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom2_Socket_Closed ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3191,6 +3323,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom3_Buffer_Null ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3233,6 +3368,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom3_Size_OutOfRange ()
                {
                        Socket s;
@@ -3274,6 +3412,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom3_Socket_Closed ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3295,6 +3436,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom4_Buffer_Null ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3314,6 +3458,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom4_Offset_OutOfRange ()
                {
                        Socket s;
@@ -3377,6 +3524,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom4_Size_OutOfRange ()
                {
                        Socket s;
@@ -3435,6 +3585,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveFrom4_Socket_Closed ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream,
@@ -3457,6 +3610,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveRemoteClosed ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -3484,6 +3640,9 @@ namespace MonoTests.System.Net.Sockets
                //
                // Test case for bug #471580
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UdpDoubleBind ()
                {
                        using (Socket s = new Socket (AddressFamily.InterNetwork,
@@ -3517,6 +3676,9 @@ namespace MonoTests.System.Net.Sockets
 
                // Test case for bug #31557
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TcpDoubleBind ()
                {
                        using (Socket s = new Socket (AddressFamily.InterNetwork,
@@ -3755,6 +3917,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_AddMembershipIPv4_IPv6MulticastOption ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("239.255.255.250");
@@ -3777,6 +3942,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_AddMembershipIPv4_MulticastOption ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("239.255.255.250");
@@ -3813,6 +3981,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_AddMembershipIPv6_IPv6MulticastOption ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -3828,6 +3999,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_AddMembershipIPv6_MulticastOption ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -3982,6 +4156,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_DropMembershipIPv4_IPv6MulticastOption ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("239.255.255.250");
@@ -4006,6 +4183,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_DropMembershipIPv4_MulticastOption ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("239.255.255.250");
@@ -4046,6 +4226,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_DropMembershipIPv6_IPv6MulticastOption ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -4064,6 +4247,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SetSocketOption3_DropMembershipIPv6_MulticastOption ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -4150,6 +4336,7 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+               [Category ("RequiresBSDSockets")] // on watchOS device this happens: System.Net.Sockets.SocketException : The requested address is not valid in this context. This situation is too complex to detect and throw a PlatformNotSupportedException, so just ignore it.
                public void SetSocketOption_MulticastInterfaceIndex_Any ()
                {
                        IPAddress ip = IPAddress.Parse ("239.255.255.250");
@@ -4162,6 +4349,7 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+               [Category ("RequiresBSDSockets")] // on watchOS device this happens: System.Net.Sockets.SocketException : The requested address is not valid in this context. This situation is too complex to detect and throw a PlatformNotSupportedException, so just ignore it.
                public void SetSocketOption_MulticastInterfaceIndex_Loopback ()
                {
                        IPAddress ip = IPAddress.Parse ("239.255.255.250");
@@ -4198,6 +4386,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Shutdown_NoConnect ()
                {
                        Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@@ -4294,6 +4485,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SendAsyncFile ()
                {
                        Socket serverSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@@ -4352,6 +4546,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectToIPV4EndPointUsingDualModelSocket () {
                        /*
                         * IPv6 DualMode sockets are defaults in Mono. Explicitly specify that
@@ -4392,6 +4589,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginConnectToIPV4EndPointUsingDualModelSocket () {
                        /*
                         * IPv6 DualMode sockets are defaults in Mono. Explicitly specify that
@@ -4435,6 +4635,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UdpMulticasTimeToLive ()
                {
                        /* see https://bugzilla.xamarin.com/show_bug.cgi?id=36941 */
index 4d3b8325048d9038ebfcaf8210960ebc71562f1a..5db3aadbc877713b962285ddcde3e66e83293cde 100644 (file)
@@ -21,7 +21,6 @@ namespace MonoTests.System.Net.Sockets
        /// Tests System.Net.Sockets.TcpClient
        /// </summary>
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class TcpClientTest
        {
                
@@ -30,6 +29,9 @@ namespace MonoTests.System.Net.Sockets
                /// (from System.Net.Sockets)
                /// </summary>
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TcpClient()
                {
                        // set up a listening Socket
@@ -77,6 +79,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test] // bug #81105
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseTest ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -140,7 +145,11 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConnectMultiNull ()
                {
                        TcpClient client = new TcpClient ();
@@ -150,6 +159,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectMultiAny ()
                {
                        TcpClient client = new TcpClient ();
@@ -168,6 +180,9 @@ namespace MonoTests.System.Net.Sockets
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectMultiRefused ()
                {
                        TcpClient client = new TcpClient ();
index 1e211cf524920b999f0f090353814030a6dff829..25e8854ed6a87635c18cdec0a9f8778959ad2327 100644 (file)
@@ -20,10 +20,12 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net.Sockets
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class TcpListenerTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TcpListener ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -75,6 +77,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CtorInt1 ()
                {
                        int nex = 0;
@@ -87,21 +92,33 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void CtorIPEndPoint ()
                {
                        new TcpListener (null);
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void CtorIPAddressInt1 ()
                {
                        new TcpListener (null, 100000);
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentOutOfRangeException))]
+#endif
                public void CtorIPAddressInt2 ()
                {
                        new TcpListener (IPAddress.Any, 100000);
@@ -125,6 +142,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PreStartStatus ()
                {
                        MyListener listener = new MyListener ();
@@ -152,6 +172,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PostStartStatus ()
                {
                        MyListener listener = new MyListener ();
@@ -173,6 +196,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StartListenMoreThan5 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
index 66b15308d1f84cb08efaae91d0bbe5b8e3acc62d..996da16f5cc0009ee0b3a56b4e6334812ba89508 100644 (file)
@@ -15,9 +15,11 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Net.Sockets {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class UdpClientTest {
                [Test] // .ctor ()
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor1 ()
                {
                        MyUdpClient client;
@@ -43,6 +45,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2 ()
                {
                        MyUdpClient client;
@@ -88,6 +93,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2_Family_Invalid ()
                {
                        try {
@@ -114,6 +122,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3 ()
                {
                        Socket s;
@@ -163,6 +174,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3_Port_OutOfRange ()
                {
                        try {
@@ -189,6 +203,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (IPEndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4 ()
                {
                        Socket s;
@@ -221,6 +238,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (IPEndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4_LocalEP_Null ()
                {
                        try {
@@ -235,6 +255,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor5 ()
                {
                        Socket s;
@@ -288,6 +311,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor5_Family_Invalid ()
                {
                        try {
@@ -318,6 +344,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor5_Port_OutOfRange ()
                {
                        try {
@@ -344,6 +373,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor6 ()
                {
                        Socket s;
@@ -394,6 +426,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor6_HostName_Null ()
                {
                        try {
@@ -408,6 +443,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor6_Port_OutOfRange ()
                {
                        try {
@@ -434,6 +472,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UdpClientBroadcastTest () 
                {
                        UdpClient client = new UdpClient ();
@@ -447,6 +488,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup1_IPv4 ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
@@ -457,6 +501,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup1_IPv6 ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -470,6 +517,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup1_MulticastAddr_Null ()
                {
                        using (UdpClient client = new UdpClient (new IPEndPoint (IPAddress.Loopback, 1234))) {
@@ -486,6 +536,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup1_Socket_Closed ()
                {
                        IPAddress mcast_addr = null;
@@ -528,6 +581,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (In32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup2_IPv4 ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
@@ -550,6 +606,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (In32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup2_IPv6 ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -563,6 +622,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (Int32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup2_MulticastAddr_Null ()
                {
                        using (UdpClient client = new UdpClient (new IPEndPoint (IPAddress.Loopback, 1234))) {
@@ -579,6 +641,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (Int32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup2_Socket_Closed ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -624,6 +689,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup3_IPv4 ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
@@ -638,6 +706,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup3_IPv6 ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -655,6 +726,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup3_MulticastAddr_Null ()
                {
                        using (UdpClient client = new UdpClient (new IPEndPoint (IPAddress.Loopback, 1234))) {
@@ -671,6 +745,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup3_Socket_Closed ()
                {
                        IPAddress mcast_addr = null;
@@ -713,6 +790,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_IPv4 ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
@@ -724,6 +804,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_IPv6 ()
                {
                        if (!Socket.OSSupportsIPv6)
@@ -750,6 +833,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_LocalAddress_Null ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
@@ -768,6 +854,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_MulticastAddr_Null ()
                {
                        using (UdpClient client = new UdpClient (new IPEndPoint (IPAddress.Loopback, 1234))) {
@@ -784,6 +873,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_Socket_Closed ()
                {
                        IPAddress mcast_addr = null;
@@ -828,6 +920,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseInReceive ()
                {
                        UdpClient client = null;
@@ -868,6 +963,9 @@ namespace MonoTests.System.Net.Sockets {
 
                // Test for bug 324033
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroupWithLocal ()
                {
                        UdpClient client = new UdpClient (9001);
@@ -882,7 +980,11 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void BeginSendNull ()
                {
                        UdpClient client = new UdpClient ();
@@ -905,6 +1007,9 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginSend ()
                {
                        UdpClient client = new UdpClient ();
@@ -959,6 +1064,9 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginReceive ()
                {
                        UdpClient client = new UdpClient (1237);
@@ -984,6 +1092,9 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Available ()
                {
                        using (UdpClient client = new UdpClient (1238)) {
@@ -1018,6 +1129,9 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void EnableBroadcastDefault ()
                {
                        UdpClient client = new UdpClient ();
@@ -1057,6 +1171,9 @@ namespace MonoTests.System.Net.Sockets {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void MulticastLoopbackDefault ()
                {
                        UdpClient client = new UdpClient ();
@@ -1067,6 +1184,9 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // #6057
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveIPv6 ()
                {
                        if (!Socket.OSSupportsIPv6)
index 4e7aa5668c35bc304532a5f6e14a716d069f1e72..e3dd58188c17358fe03c97bac68aaed04f105ef7 100644 (file)
@@ -18,31 +18,33 @@ namespace MonoTests.System.Net.WebSockets
        {
                const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx";
                int Port = NetworkHelpers.FindFreePort ();
-               HttpListener listener;
-               ClientWebSocket socket;
-               MethodInfo headerSetMethod;
-
-               [SetUp]
-               public void Setup ()
-               {
-                       listener = new HttpListener ();
-                       listener.Prefixes.Add ("http://localhost:" + Port + "/");
-                       listener.Start ();
-                       socket = new ClientWebSocket ();
+               HttpListener _listener;
+               HttpListener listener {
+                       get {
+                               if (_listener != null)
+                                       return _listener;
+                               var tmp = new HttpListener ();
+                               tmp.Prefixes.Add ("http://localhost:" + Port + "/");
+                               tmp.Start ();
+                               return _listener = tmp;
+                       }
                }
+               ClientWebSocket _socket;
+               ClientWebSocket socket { get { return _socket ?? (_socket = new ClientWebSocket ()); } }
+               MethodInfo headerSetMethod;
 
                [TearDown]
                public void Teardown ()
                {
-                       if (listener != null) {
-                               listener.Stop ();
-                               listener = null;
+                       if (_listener != null) {
+                               _listener.Stop ();
+                               _listener = null;
                        }
-                       if (socket != null) {
-                               if (socket.State == WebSocketState.Open)
-                                       socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (2000);
-                               socket.Dispose ();
-                               socket = null;
+                       if (_socket != null) {
+                               if (_socket.State == WebSocketState.Open)
+                                       _socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (2000);
+                               _socket.Dispose ();
+                               _socket = null;
                        }
                }
 
index 37c40d7445e070cd8d5021dc238253b6bdac5db5..f3c4eceea74abb0622b2945ecb3f6325a0bae2ce 100644 (file)
@@ -9,7 +9,6 @@ using NUnit.Framework;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class CookieParserTest
        {
                public const string A = "Foo=Bar, expires=World; expires=Sat, 11-Oct-14 22:45:19 GMT, A=B";
@@ -72,6 +71,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestExpires ()
                {
                        var cookies = DoRequest (A);
@@ -82,6 +84,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestInvalidCookie ()
                {
                        var cookies = DoRequest (B);
@@ -92,6 +97,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestLocalCulture ()
                {
                        var old = Thread.CurrentThread.CurrentCulture;
@@ -109,6 +117,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestMultiple ()
                {
                        var cookies = DoRequest (D);
@@ -119,6 +130,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestMultiple2 ()
                {
                        var cookies = DoRequest (E);
@@ -128,6 +142,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestQuotation ()
                {
                        var cookies = DoRequest (F);
@@ -140,6 +157,7 @@ namespace MonoTests.System.Net
                {
                        Socket socket;
                        string[] headers;
+                       Exception ex;
 
                        public Listener (params string[] headers)
                        {
@@ -155,17 +173,28 @@ namespace MonoTests.System.Net
                                socket.Bind (new IPEndPoint (IPAddress.Loopback, 0));
                                socket.Listen (1);
                                socket.BeginAccept ((result) => {
-                                       var accepted = socket.EndAccept (result);
-                                       HandleRequest (accepted);
+                                       try {
+                                               var accepted = socket.EndAccept (result);
+                                               HandleRequest (accepted);
+                                       } catch (Exception e) {
+                                               ex = e;
+                                       }
                                }, null);
                        }
 
+                       void ThrowIfException ()
+                       {
+                               if (ex != null)
+                                       throw ex;
+                       }
+
                        public void Dispose ()
                        {
                                if (socket != null) {
                                        socket.Close ();
                                        socket = null;
                                }
+                               ThrowIfException ();
                        }
 
                        void HandleRequest (Socket accepted)
@@ -183,11 +212,17 @@ namespace MonoTests.System.Net
                        }
 
                        public EndPoint EndPoint {
-                               get { return socket.LocalEndPoint; }
+                               get {
+                                       ThrowIfException ();
+                                       return socket.LocalEndPoint;
+                               }
                        }
 
                        public string URI {
-                               get { return string.Format ("http://{0}/", EndPoint); }
+                               get {
+                                       ThrowIfException ();
+                                       return string.Format ("http://{0}/", EndPoint);
+                               }
                        }
                }
        }
index e06ca4bf5d6ae6e16ca43665f144953ba1d2b1c0..fef014541882d3011f1d7bbcd4ea466b8161c2f3 100644 (file)
@@ -19,7 +19,6 @@ using NUnit.Framework;
 namespace MonoTests.System.Net\r
 {\r
        [TestFixture]\r
-       [Category ("RequiresBSDSockets")]\r
        public class DnsTest\r
        {\r
                private String site1Name = "google-public-dns-a.google.com",\r
@@ -30,6 +29,9 @@ namespace MonoTests.System.Net
                private uint site1IP = 134744072, site2IP = 134743044; // Big-Endian\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncGetHostByName ()\r
                {\r
                        IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);\r
@@ -39,6 +41,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncGetHostByNameCallback ()\r
                {\r
                        var evt = new ManualResetEvent (false);\r
@@ -61,6 +66,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncResolve ()\r
                {\r
                        IAsyncResult async = Dns.BeginResolve (site1Dot, null, null);\r
@@ -71,6 +79,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncResolveCallback ()\r
                {\r
                        var evt = new ManualResetEvent (false);\r
@@ -205,6 +216,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void GetHostByName ()\r
                {\r
                        SubTestGetHostByName (site1Name, site1Dot);\r
@@ -336,6 +350,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginResolve_HostName_Null ()\r
                {\r
                        try {\r
@@ -352,6 +369,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Resolve ()\r
                {\r
                        SubTestResolve (site1Name);\r
@@ -367,6 +387,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Resolve_HostName_Null ()\r
                {\r
                        try {\r
@@ -381,6 +404,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (IPAddress, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry1_Address_Null ()\r
                {\r
                        try {\r
@@ -398,6 +424,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (String, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry2_HostNameOrAddress_Null ()\r
                {\r
                        try {\r
@@ -415,6 +444,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (String, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry2_HostNameOrAddress_UnspecifiedAddress ()\r
                {\r
                        // IPv4\r
@@ -473,6 +505,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // GetHostEntry (String)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void GetHostEntry2 ()\r
                {\r
                        Dns.GetHostEntry (site1Name); // hostname\r
index 5f4166eecf855549bfd4ea8a51d9ffa556b14cb1..6793d2a48fdeffefa3c47d532c664f915bcc4330 100644 (file)
@@ -25,7 +25,6 @@ using NUnit.Framework;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class FileWebRequestTest
        {
                private string _tempDirectory;
index 93697cd29294145f8c1466224e44eacb5b210667..8143edd7571492b7566dc025ffe0a8e076be7c69 100644 (file)
@@ -19,10 +19,12 @@ using System.Threading;
 namespace MonoTests.System.Net 
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class FtpWebRequestTest
        {
-               FtpWebRequest defaultRequest;
+               FtpWebRequest _defaultRequest;
+               FtpWebRequest defaultRequest {
+                       get { return _defaultRequest ?? (_defaultRequest = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com")); }
+               }
                
                private string _tempDirectory;
                private string _tempFile;
@@ -49,25 +51,31 @@ namespace MonoTests.System.Net
                                Directory.Delete (_tempDirectory, true);
                }
 
-               [TestFixtureSetUp]
-               public void Init ()
-               {
-                       defaultRequest = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com");
-               }
-               
                [Test]
                public void ContentLength ()
                {
                        try {
                                long l = defaultRequest.ContentLength;
+#if FEATURE_NO_BSD_SOCKETS
+                               Assert.Fail ("#1a");
+                       } catch (PlatformNotSupportedException) {
+                               // OK.
+#else
                        } catch (NotSupportedException) {
                                Assert.Fail ("#1"); // Not overriden
+#endif
                        }
 
                        try {
                                defaultRequest.ContentLength = 2;
+#if FEATURE_NO_BSD_SOCKETS
+                               Assert.Fail ("#2a");
+                       } catch (PlatformNotSupportedException) {
+                               // OK.
+#else
                        } catch (NotSupportedException) {
                                Assert.Fail ("#2"); // Not overriden
+#endif
                        }
                }
 
@@ -88,6 +96,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentOffset ()
                {
                        try {
@@ -98,6 +109,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Credentials ()
                {
                        try {
@@ -109,6 +123,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Method ()
                {
                        try {
@@ -146,6 +163,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadWriteTimeout ()
                {
                        try {
@@ -156,6 +176,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Timeout ()
                {
                        try {
@@ -166,6 +189,9 @@ namespace MonoTests.System.Net
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultValues ()
                {
                        FtpWebRequest request = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com");
@@ -183,6 +209,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void RenameTo ()
                {
                        try {
@@ -199,6 +228,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadFile1 ()
                {
                        ServerPut sp = new ServerPut ();
@@ -229,6 +261,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadFile_WebClient ()
                {
                        ServerPut sp = new ServerPut ();
@@ -247,6 +282,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DownloadFile1 ()
                {
                        DownloadFile (new ServerDownload ());
@@ -279,6 +317,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DownloadFile2 ()
                {
                        // Some embedded FTP servers in Industrial Automation Hardware report
@@ -287,6 +328,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DeleteFile1 ()
                {
                        ServerDeleteFile sp = new ServerDeleteFile ();
@@ -313,6 +357,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ListDirectory1 ()
                {
                        ServerListDirectory sp = new ServerListDirectory ();
index b0cedc555a4e8b34674790e2d6744c1a0e269b53..51e2990c0d18129f63dc2a748c8aa79707e1f4fa 100644 (file)
@@ -47,7 +47,6 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net {
        
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpListener2Test {
                
                private HttpListener _listener = null;
@@ -147,6 +146,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test1 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -159,6 +161,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test2 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -171,6 +176,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test3 ()
                {
                        StringBuilder bad = new StringBuilder ();
@@ -210,6 +218,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test4 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -222,6 +233,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test5 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -234,6 +248,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test6 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -247,6 +264,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test7 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -263,6 +283,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test8 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -280,6 +303,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test9 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -295,6 +321,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test10 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -311,6 +340,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test11 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -325,6 +357,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test12 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -339,6 +374,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test13 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -356,6 +394,9 @@ namespace MonoTests.System.Net {
                ManualResetEvent test_evt;
                bool test14_error;
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test14 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -392,6 +433,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test15 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -414,6 +458,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test16 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -438,6 +485,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test17 ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -454,6 +504,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test_MultipleClosesOnOuputStreamAllowed ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -484,6 +537,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReceiveCookiesFromClient ()
                {
                        sendCookiePort = NetworkHelpers.FindFreePort ();                        
@@ -530,6 +586,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SendCookiestoClient ()
                {
                        receiveCookiePort = NetworkHelpers.FindFreePort ();
@@ -581,6 +640,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void MultiResponses ()
                {
                        echoServerPort = NetworkHelpers.FindFreePort ();
@@ -646,9 +708,11 @@ namespace MonoTests.System.Net {
        }
 
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpListenerBugs {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestNonChunkedAsync ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -703,6 +767,9 @@ namespace MonoTests.System.Net {
                // a documented pattern to close the connection
                // 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test_MultipleConnections ()
                {
                        var port = NetworkHelpers.FindFreePort ();                      
@@ -733,6 +800,9 @@ namespace MonoTests.System.Net {
                // Test case for bug 341443, an pretty old bug, filed on November of 2007.
                //
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test_HostInUri ()
                {
                        var wait = new ManualResetEvent (false);
@@ -762,6 +832,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test] // bug #513849
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ClosePort ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -785,6 +858,9 @@ namespace MonoTests.System.Net {
                // does not also listen to another interface.
                //
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BindToSingleInterface ()
                {
                        IPAddress [] machineAddress = null;
@@ -811,6 +887,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BindToAllInterfaces ()
                {
                        var h = new HttpListener ();
@@ -823,6 +902,9 @@ namespace MonoTests.System.Net {
 
                // Test case for bug #31209
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Test_EmptyLineAtStart ()
                {
                        var port = NetworkHelpers.FindFreePort ();
index 21589dc6c30914ebe227c22b04a99143a720457e..b09a8180eafd6593fa30a07a9878138a93727de6 100644 (file)
@@ -36,6 +36,9 @@ namespace MonoTests.System.Net {
        public class HttpListenerPrefixCollectionTest {
                // NL -> Not listening -> tests when listener.IsListening == false
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NL_DefaultProperties ()
                {
                        HttpListener listener = new HttpListener ();
@@ -46,6 +49,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultProperties ()
                {
                        HttpListener listener = new HttpListener ();
@@ -57,7 +63,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AddOne ()
                {
                        HttpListener listener = new HttpListener ();
@@ -71,7 +79,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
-               [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Duplicate ()
                {
                        HttpListener listener = new HttpListener ();
@@ -86,6 +96,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void EndsWithSlash ()
                {
                        HttpListener listener = new HttpListener ();
@@ -93,6 +106,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DifferentPath ()
                {
                        HttpListener listener = new HttpListener ();
@@ -102,6 +118,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NL_Clear ()
                {
                        HttpListener listener = new HttpListener ();
@@ -110,6 +129,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NL_Remove ()
                {
                        HttpListener listener = new HttpListener ();
@@ -118,6 +140,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NL_RemoveBadUri ()
                {
                        HttpListener listener = new HttpListener ();
@@ -126,7 +151,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void NL_AddBadUri ()
                {
                        HttpListener listener = new HttpListener ();
@@ -135,7 +164,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void NoHostInUrl ()
                {
                        HttpListener listener = new HttpListener ();
@@ -143,6 +176,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void MultipleSlashes ()
                {
                        // this one throws on Start(), not when adding it.
@@ -156,6 +192,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PercentSign ()
                {
                        HttpListener listener = new HttpListener ();
@@ -169,6 +208,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Disposed1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -180,7 +222,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed2 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -190,7 +236,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed3 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -200,7 +250,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed4 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -210,7 +264,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void Disposed5 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -221,6 +279,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Disposed6 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -234,6 +295,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Disposed7 ()
                {
                        HttpListener listener = new HttpListener ();
index c9227fd5b39dc09c6ce53f618c084c05d56b6b7f..d782103f33e33709321e1c7f2211d2b4fccf8a90 100644 (file)
@@ -42,7 +42,6 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpListenerRequestTest
        {
                [Test]
@@ -151,6 +150,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpMethod ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -165,6 +167,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpBasicAuthScheme ()
                {
                        var port = NetworkHelpers.FindFreePort ();                      
@@ -180,6 +185,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpRequestUriIsNotDecoded ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -194,6 +202,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpRequestIsLocal ()
                {
                        var port = NetworkHelpers.FindFreePort ();
@@ -221,6 +232,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // #29927
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpRequestUriUnescape ()
                {
                        var prefix = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
index 70dcede89717281e238f732afa91b55935082777..bbd716c0ed267f6c00aeb6956e16cbc354b1bb51 100644 (file)
@@ -37,17 +37,17 @@ using MonoTests.Helpers;
 
 namespace MonoTests.System.Net {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpListenerTest {
 
-               int port;
-
-               [SetUp]
-               public void SetUp () {
-                       port = NetworkHelpers.FindFreePort ();
+               int? _port;
+               int port {
+                       get { return _port ?? (_port = NetworkHelpers.FindFreePort ()).Value; }
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultProperties ()
                {
                        HttpListener listener = new HttpListener ();
@@ -61,6 +61,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Start1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -68,6 +71,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Stop1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -75,7 +81,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (InvalidOperationException))]
+#endif
                public void GetContext1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -84,7 +94,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (InvalidOperationException))]
+#endif
                public void GetContext2 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -94,7 +108,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (InvalidOperationException))]
+#endif
                public void BeginGetContext1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -103,6 +121,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetContext2 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -135,6 +156,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultHttpPort ()
                {
                        if (!CanOpenPort (80))
@@ -148,6 +172,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultHttpsPort ()
                {
                        if (!CanOpenPort (443))
@@ -161,6 +188,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TwoListeners_SameAddress ()
                {
                        if (!CanOpenPort (port))
@@ -174,7 +204,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (HttpListenerException))]
+#endif
                public void TwoListeners_SameURL ()
                {
                        if (!CanOpenPort (port))
@@ -188,7 +222,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (HttpListenerException))]
+#endif
                public void MultipleSlashes ()
                {
                        if (!CanOpenPort (port))
@@ -200,7 +238,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (HttpListenerException))]
+#endif
                public void PercentSign ()
                {
                        if (!CanOpenPort (port))
@@ -212,6 +254,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseBeforeStart ()
                {
                        HttpListener listener = new HttpListener ();
@@ -219,6 +264,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseTwice ()
                {
                        if (!CanOpenPort (port))
@@ -231,6 +279,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StartStopStart ()
                {
                        if (!CanOpenPort (port))
@@ -244,6 +295,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StartStopDispose ()
                {
                        if (!CanOpenPort (port))
@@ -256,6 +310,9 @@ namespace MonoTests.System.Net {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AbortBeforeStart ()
                {
                        HttpListener listener = new HttpListener ();
@@ -263,6 +320,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AbortTwice ()
                {
                        if (!CanOpenPort (port))
@@ -275,6 +335,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PropertiesWhenClosed1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -288,7 +351,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosed2 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -297,7 +364,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosedSet1 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -306,7 +377,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosedSet2 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -315,7 +390,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosedSet3 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -324,7 +403,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosedSet4 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -333,7 +416,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ObjectDisposedException))]
+#endif
                public void PropertiesWhenClosedSet5 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -342,6 +429,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PropertiesWhenClosed3 ()
                {
                        HttpListener listener = new HttpListener ();
@@ -350,6 +440,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseWhileBegin ()
                {
                        HttpListener listener = new HttpListener ();
@@ -366,6 +459,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AbortWhileBegin ()
                {
                        HttpListener listener = new HttpListener ();
@@ -382,7 +478,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (HttpListenerException))]
+#endif
                public void CloseWhileGet ()
                {
                        // "System.Net.HttpListener Exception : The I/O operation has been aborted
@@ -399,7 +499,11 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (HttpListenerException))]
+#endif
                public void AbortWhileGet ()
                {
                        // "System.Net.HttpListener Exception : The I/O operation has been aborted
@@ -479,6 +583,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConnectionReuse ()
                {
                        var uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
@@ -536,6 +643,9 @@ namespace MonoTests.System.Net {
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UserHeaderWithDoubleMultiValue ()
                {
                        string uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
@@ -563,6 +673,9 @@ namespace MonoTests.System.Net {
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HttpClientIsDisconnectedCheckForWriteException()
                {
                        string uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
index 0d5763967b0d01256f3504a608fc899dfa65941e..a597b4cd0a240dd08b9f9f2e1722d4a28bcc6754 100644 (file)
@@ -36,7 +36,6 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpWebRequestTest
        {
                private Random rand = new Random ();
@@ -45,11 +44,16 @@ namespace MonoTests.System.Net
                [TestFixtureSetUp]
                public void Setup ()
                {
+#if !FEATURE_NO_BSD_SOCKETS
                                ServicePointManager.Expect100Continue = false;
+#endif
                                rand.NextBytes (data64KB);
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Proxy_Null ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
@@ -60,6 +64,9 @@ namespace MonoTests.System.Net
 
                [Test]
                [Category("InetAccess")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Sync ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
@@ -81,6 +88,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AddRange ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
@@ -96,6 +106,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #471782
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CloseRequestStreamAfterReadingResponse ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -182,6 +195,9 @@ namespace MonoTests.System.Net
                }
 #endif
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Missing_ContentEncoding ()
                {
                        ServicePointManager.CertificatePolicy = new AcceptAllPolicy ();
@@ -204,6 +220,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BadServer_ChunkedClose ()
                {
                        // The server will send a chunked response without a 'last-chunked' mark
@@ -269,6 +288,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStream_Body_NotAllowed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -306,6 +328,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #465613
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStream_NoBuffering ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -455,6 +480,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStream_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -480,6 +508,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetResponse_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -505,6 +536,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void EndGetRequestStream_AsyncResult_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -583,6 +617,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void EndGetResponse_AsyncResult_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -614,6 +651,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #429200
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetRequestStream ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -636,6 +676,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetRequestStream_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -931,6 +974,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetResponse_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -987,6 +1033,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #324300
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AllowAutoRedirect ()
                {
                        IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1033,6 +1082,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PostAndRedirect_NoCL ()
                {
                        IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1061,6 +1113,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PostAndRedirect_CL ()
                {
                        IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1089,6 +1144,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PostAnd401 ()
                {
                        IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1250,6 +1308,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #513087
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NonStandardVerb ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1361,11 +1422,11 @@ namespace MonoTests.System.Net
 
                        internal void LaunchWebRequest ()
                        {
-                               var req = (HttpWebRequest) WebRequest.Create (url_to_test);
-                               req.Timeout = TimeOutInMilliSeconds;
-
-                               Start = DateTime.Now;
                                try {
+                                       var req = (HttpWebRequest) WebRequest.Create (url_to_test);
+                                       req.Timeout = TimeOutInMilliSeconds;
+
+                                       Start = DateTime.Now;
                                        using (var resp = (HttpWebResponse) req.GetResponse ())
                                        {
                                                var sr = new StreamReader (resp.GetResponseStream (), Encoding.UTF8);
@@ -1416,6 +1477,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // 1st possible case of https://bugzilla.novell.com/show_bug.cgi?id=MONO74177
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestTimeoutPropertyWithServerThatExistsAndRespondsButTooLate ()
                {
                        var ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1428,6 +1492,7 @@ namespace MonoTests.System.Net
                }
 
                [Test] // 2nd possible case of https://bugzilla.novell.com/show_bug.cgi?id=MONO74177
+               [Category ("RequiresBSDSockets")] // Requires some test refactoring to assert that a PlatformNotSupportedException is thrown, so don't bother (there's plenty of other tests asserting the PlatformNotSupported exceptions).
                public void TestTimeoutWithEndpointThatDoesntExistThrowsConnectFailureBeforeTimeout ()
                {
                        string url = "http://127.0.0.1:8271/"; // some endpoint that is unlikely to exist
@@ -1682,6 +1747,9 @@ namespace MonoTests.System.Net
                        return Encoding.UTF8.GetBytes (sw.ToString ());
                }
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NtlmAuthentication ()
                {
                        NtlmServer server = new NtlmServer ();
@@ -1824,6 +1892,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStream ()
                {
                        this.DoRequest (
@@ -1842,6 +1913,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStreamNoClose ()
                {
                        this.DoRequest (
@@ -1859,6 +1933,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetRequestStreamCancelIfNotAllBytesWritten ()
                {
                        this.DoRequest (
@@ -1883,6 +1960,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetRequestStream2 ()
                {
                        this.DoRequest (
@@ -1899,6 +1979,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetRequestStreamNotAllBytesWritten ()
                {
                        this.DoRequest (
@@ -1914,6 +1997,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetRequestStreamTimeout ()
                {
                        this.DoRequest (
@@ -1929,6 +2015,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginWrite ()
                {
                        byte[] received = new byte[data64KB.Length];
@@ -1961,6 +2050,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginWriteAfterAbort ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -1988,6 +2080,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PrematureStreamCloseAborts ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2015,6 +2110,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2086,6 +2184,9 @@ namespace MonoTests.System.Net
                **/
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2113,6 +2214,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadTimeout2 ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2142,6 +2246,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadServerAborted ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2166,6 +2273,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetResponse2 ()
                {
                        byte [] received = new byte [data64KB.Length];
@@ -2196,6 +2306,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginGetResponseAborts ()
                {
                        ManualResetEvent aborted = new ManualResetEvent(false);
@@ -2226,6 +2339,9 @@ namespace MonoTests.System.Net
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void TestLargeDataReading ()
                {
                        int near2GBStartPosition = rand.Next (int.MaxValue - 500, int.MaxValue);
@@ -2323,7 +2439,11 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void NullHost ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2331,6 +2451,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NoHost ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2338,7 +2461,11 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void EmptyHost ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2346,6 +2473,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void HostAndPort ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com:80");
@@ -2355,6 +2485,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void PortRange ()
                {
                        for (int i = 0; i < 65536; i++) {
@@ -2367,7 +2500,11 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void PortBelow ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2375,7 +2512,11 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void PortAbove ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2383,7 +2524,11 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentException))]
+#endif
                public void HostTooLong ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2403,6 +2548,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void NoDate ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2410,6 +2558,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UtcDate ()
                {
                        HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
@@ -2419,6 +2570,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AddAndRemoveDate ()
                {
                        // Neil Armstrong set his foot on Moon
@@ -2452,6 +2606,9 @@ namespace MonoTests.System.Net
                }
                
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                // Bug #12393
                public void TestIPv6Host ()
                {
@@ -2483,6 +2640,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AllowReadStreamBuffering ()
                {
                        var hr = WebRequest.CreateHttp ("http://www.google.com");
@@ -2680,6 +2840,9 @@ namespace MonoTests.System.Net
 #endif
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CookieContainerTest ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2761,10 +2924,12 @@ namespace MonoTests.System.Net
        }
 
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpRequestStreamTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginRead ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2820,6 +2985,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanRead ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2842,6 +3010,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanSeek ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2864,6 +3035,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #324182
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2886,6 +3060,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanWrite ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2908,6 +3085,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2935,6 +3115,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadByte ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2961,6 +3144,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -2983,6 +3169,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Seek ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3009,6 +3198,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Buffer_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3035,6 +3227,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Count_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3063,6 +3258,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Count_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3091,6 +3289,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Offset_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3119,6 +3320,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Offset_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3147,6 +3351,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3202,6 +3409,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void WriteByte_Request_Aborted ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3229,6 +3439,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void WriteTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -3251,6 +3464,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                // Bug6737
                // This test is supposed to fail prior to .NET 4.0
                public void Post_EmptyRequestStream ()
index 10d7d807444ce7527e56c73b601788be68f08664..b2c8e90488c059be03460d907142b53827d3a03f 100644 (file)
@@ -21,10 +21,12 @@ using NUnit.Framework;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpWebResponseTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CharacterSet_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -53,6 +55,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Close_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -72,6 +77,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentEncoding_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -100,6 +108,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentLength_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -120,6 +131,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentType_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -148,6 +162,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Cookies_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -186,6 +203,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetResponseHeader_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -214,6 +234,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetResponseStream_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -242,6 +265,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Headers_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -269,6 +295,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void LastModified_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -297,6 +326,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Method_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -325,6 +357,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ProtocolVersion_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -353,6 +388,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ResponseUri_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -381,6 +419,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Server_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -409,6 +450,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StatusCode_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -429,6 +473,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StatusDescription_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -477,10 +524,12 @@ namespace MonoTests.System.Net
        }
 
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpResponseStreamTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginRead_Buffer_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -530,6 +579,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginWrite ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -590,6 +642,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanSeek ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -617,6 +672,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #324182
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -644,6 +702,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanWrite ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -671,6 +732,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -708,6 +772,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Buffer_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -757,6 +824,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Count_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -807,6 +877,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Count_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -857,6 +930,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Offset_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -907,6 +983,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Offset_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1021,6 +1100,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1048,6 +1130,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1080,6 +1165,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void WriteTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
index 346f35bdeacd358202f49bad9a130cef91bd0066..1e848148f92c21783688163be5f07e1fcb669a87 100644 (file)
@@ -13,7 +13,7 @@ using System;
 using System.Collections;\r
 using System.IO;\r
 using System.Net;\r
-using System.Reflection;
+using System.Reflection;\r
 using System.Threading;\r
 \r
 namespace MonoTests.System.Net\r
@@ -54,13 +54,13 @@ public class ServicePointTest
                HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");\r
                HttpWebResponse res = (HttpWebResponse) req.GetResponse ();                     \r
                \r
-#if FOUND_SOME_OTHER_URL
-               // URL is no longer found, disabled the test until a more reliable URL is found :P
+#if FOUND_SOME_OTHER_URL\r
+               // URL is no longer found, disabled the test until a more reliable URL is found :P\r
                //WriteServicePoint ("google after getting a response", google);\r
                ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));\r
                Assert.AreEqual (google, google2, "#equals");\r
                res.Close ();\r
-#endif
+#endif\r
                \r
                // in both instances property CurrentConnections is 0 according to ms.net.\r
                // let's see what it says when we do async operations...\r
@@ -87,8 +87,8 @@ public class ServicePointTest
                //Console.WriteLine ("ContentLength: " + res2.ContentLength);\r
                res2.Close ();\r
                \r
-               ServicePoint sp2;
-#if FOUND_SOME_OTHER_URL
+               ServicePoint sp2;\r
+#if FOUND_SOME_OTHER_URL\r
                // unless of course some buffering is taking place.. let's check\r
                Uri uri2 = new Uri ("http://freedesktop.org/Software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz");\r
                sp2 = ServicePointManager.FindServicePoint (uri2);\r
@@ -102,7 +102,7 @@ public class ServicePointTest
                // and so it shows\r
                //Console.WriteLine ("ContentLength: " + res2.ContentLength);\r
                res2.Close ();\r
-#endif
+#endif\r
                \r
                \r
                // what's the limit of the cache?\r
@@ -154,7 +154,7 @@ public class ServicePointTest
 \r
        [Test]\r
        [Category ("InetAccess")]\r
-       [Category ("AndroidNotWorking")] // #A1 fails
+       [Category ("AndroidNotWorking")] // #A1 fails\r
        public void EndPointBind ()\r
        {\r
                Uri uri = new Uri ("http://www.go-mono.com/");\r
@@ -189,6 +189,10 @@ public class ServicePointTest
        }\r
 \r
        [Test] //Covers #19823\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       // This test uses HttpWebRequest\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
        public void CloseConnectionGroupConcurency ()\r
        {\r
                // Try with multiple service points\r
@@ -206,36 +210,37 @@ public class ServicePointTest
                }\r
        }\r
 \r
-
-       [Test]
-       public void DnsRefreshTimeout ()
-       {
-               const int dnsRefreshTimeout = 2000;
-
-               ServicePoint sp;
-               IPHostEntry host0, host1, host2;
-               Uri uri;
-               PropertyInfo hostEntryProperty;
-
-               ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;
-
-               uri = new Uri ("http://localhost/");
-               sp = ServicePointManager.FindServicePoint (uri);
-
-               hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);
-
-               host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
-               host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
-
-               Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");
-
-               Thread.Sleep (dnsRefreshTimeout * 2);
-               host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
-
-               Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +
-                               "object when DnsRefreshTimeout is reached.");
-       }
-
+\r
+       [Test]\r
+       [Category ("RequiresBSDSockets")] // Tests internals, so it doesn't make sense to assert that PlatformNotSupportedExceptions are thrown.\r
+       public void DnsRefreshTimeout ()\r
+       {\r
+               const int dnsRefreshTimeout = 2000;\r
+\r
+               ServicePoint sp;\r
+               IPHostEntry host0, host1, host2;\r
+               Uri uri;\r
+               PropertyInfo hostEntryProperty;\r
+\r
+               ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;\r
+\r
+               uri = new Uri ("http://localhost/");\r
+               sp = ServicePointManager.FindServicePoint (uri);\r
+\r
+               hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);\r
+\r
+               host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
+               host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
+\r
+               Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");\r
+\r
+               Thread.Sleep (dnsRefreshTimeout * 2);\r
+               host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
+\r
+               Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +\r
+                               "object when DnsRefreshTimeout is reached.");\r
+       }\r
+\r
 // Debug code not used now, but could be useful later\r
 /*\r
        private void WriteServicePoint (string label, ServicePoint sp)\r
index 1a6c45179aa8f65d7fb4e63909010ca984332d54..3b048781f29ad6a15109241cb99f362d55b2f521 100644 (file)
@@ -21,7 +21,6 @@ using MonoTests.Helpers;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class WebClientTest
        {
                private string _tempFolder;
@@ -1419,6 +1418,9 @@ namespace MonoTests.System.Net
 
                [Test]
                [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadValues1 ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
@@ -1669,6 +1671,10 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               // We throw a PlatformNotSupportedException deeper, which is caught and re-thrown as WebException
+               [ExpectedException (typeof (WebException))]
+#endif
                public void GetWebRequestOverriding ()
                {
                        GetWebRequestOverridingTestClass testObject = new GetWebRequestOverridingTestClass ();
@@ -1783,6 +1789,9 @@ namespace MonoTests.System.Net
                 
                [Test]
                [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadStringAsyncCancelEvent ()
                {
                        UploadAsyncCancelEventTest (9301, (webClient, uri, cancelEvent) =>
@@ -1800,6 +1809,9 @@ namespace MonoTests.System.Net
 
                [Test]
                [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadDataAsyncCancelEvent ()
                {
                        UploadAsyncCancelEventTest (9302, (webClient, uri, cancelEvent) =>
@@ -1816,6 +1828,9 @@ namespace MonoTests.System.Net
                
                [Test]
                [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadValuesAsyncCancelEvent ()
                {
                        UploadAsyncCancelEventTest (9303, (webClient, uri, cancelEvent) =>
@@ -1832,6 +1847,9 @@ namespace MonoTests.System.Net
 
                [Test]
                [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadFileAsyncCancelEvent ()
                {
                        UploadAsyncCancelEventTest (9304,(webClient, uri, cancelEvent) =>
@@ -1851,6 +1869,9 @@ namespace MonoTests.System.Net
 
                [Test]
                [Category ("AndroidNotWorking")] // Test suite hangs if the tests runs as part of the entire BCL suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UploadFileAsyncContentType ()
                {
                        var port = NetworkHelpers.FindFreePort ();
index 1e21e43dc211db035e6e52457c7bb46e0e1e1a5a..c2bdeba6ab2575f999a524d17b242c27e93e2cfd 100644 (file)
@@ -124,6 +124,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void AddRestricted ()
                {
                        col = CreateRestrictedHeaders ();
@@ -236,6 +239,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void RemoveRestricted ()
                {
                        col = CreateRestrictedHeaders ();
index 34ce1a370a1d4ed737bfe721ce2d4e03104c27b0..074c97d6982dcc787a0b3d64df4676c298bd9141 100644 (file)
 //\r
 \r
 using NUnit.Framework;\r
-using MonoTests.Helpers;
+using MonoTests.Helpers;\r
 using System;\r
 using System.Net;\r
-using System.Threading;
+using System.Threading;\r
 using System.Collections;\r
 using System.Runtime.Serialization;\r
 using Socks = System.Net.Sockets;\r
@@ -193,6 +193,9 @@ namespace MonoTests.System.Net {
                }\r
 \r
        [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
        public void All ()\r
        {\r
                WebRequest req = WebRequest.Create ("http://www.contoso.com");\r
@@ -264,6 +267,9 @@ namespace MonoTests.System.Net {
        }\r
 \r
        [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
        public void DefaultWebProxy ()\r
        {\r
                WebProxy proxy = new WebProxy ("proxy.intern.com", 83);\r
@@ -318,14 +324,18 @@ namespace MonoTests.System.Net {
        }\r
 \r
        [Test] //BNC#323452\r
-       // Throws exception with Status == Timeout. The same code behaves as the test expects when run from a regular app.
-       // Might be an issue with the test suite. To investigate.
-       [Category("AndroidNotWorking")] 
+       // Throws exception with Status == Timeout. The same code behaves as the test expects when run from a regular app.\r
+       // Might be an issue with the test suite. To investigate.\r
+       [Category("AndroidNotWorking")] \r
        public void TestFailedConnection ()\r
        {\r
                try {\r
                        WebRequest.Create ("http://127.0.0.1:0/non-existant.txt").GetResponse ();\r
                        Assert.Fail ("Should have raised an exception");\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               } catch (PlatformNotSupportedException) {\r
+                       // Expected\r
+#endif\r
                } catch (Exception e) {\r
                        Assert.IsTrue (e is WebException, "Got " + e.GetType ().Name + ": " + e.Message);\r
                        //#if NET_2_0 e.Message == "Unable to connect to the remote server"\r
@@ -342,7 +352,7 @@ namespace MonoTests.System.Net {
        }\r
 \r
        [Test] //BNC#323452\r
-       [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+       [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran\r
        public void TestFailedResolution ()\r
        {\r
                try {\r
@@ -359,6 +369,10 @@ namespace MonoTests.System.Net {
                                Assert.Ignore ("Misbehaving DNS server.");\r
 \r
                        Assert.Fail ("Should have raised an exception");\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               } catch (PlatformNotSupportedException) {\r
+                       // Expected\r
+#endif\r
                } catch (Exception e) {\r
                        Assert.IsTrue (e is WebException);\r
                        //#if NET_2_0 e.Message == "The underlying connection was closed: The remote name could not be resolved."\r
@@ -412,53 +426,55 @@ namespace MonoTests.System.Net {
        {\r
                internal TestWebRequest3 () { }\r
        }\r
-
-       [Test] // Covers #41477
-       [Category ("RequiresBSDSockets")]
-       public void TestReceiveCancelation ()
-       {
-               var uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
-
-               HttpListener listener = new HttpListener ();
-               listener.Prefixes.Add (uri);
-               listener.Start ();
-
-               try {
-                       for (var i = 0; i < 10; i++) {
-                               var request = WebRequest.CreateHttp (uri);
-                               request.Method = "GET";
-
-                               var tokenSource = new CancellationTokenSource ();
-                               tokenSource.Token.Register(() => request.Abort ());
-
-                               var responseTask = request.GetResponseAsync ();
-
-                               var context = listener.GetContext ();
-                               byte[] outBuffer = new byte[8 * 1024];
-                               context.Response.OutputStream.WriteAsync (outBuffer, 0, outBuffer.Length);
-
-                               Assert.IsTrue (responseTask.Wait (1000), "Timeout #1");
-
-                               WebResponse response = responseTask.Result;
-                               var stream = response.GetResponseStream ();
-
-                               byte[] buffer = new byte[8 * 1024];
-                               var taskRead = stream.ReadAsync (buffer, 0, buffer.Length, tokenSource.Token);
-
-                               tokenSource.Cancel ();
-
-                               Assert.IsTrue (taskRead.Wait (1000), "Timeout #2");
-
-                               var byteRead = taskRead.Result;
-                       }
-               } catch (AggregateException ex) {
-                       var webEx = ex.InnerException as WebException;
-                       Assert.IsNotNull(webEx, "Inner exception is not a WebException");
-                       Assert.AreEqual (webEx.Status, WebExceptionStatus.RequestCanceled);
-               }
-
-               listener.Close ();
-       }
+\r
+       [Test] // Covers #41477\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
+       public void TestReceiveCancelation ()\r
+       {\r
+               var uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";\r
+\r
+               HttpListener listener = new HttpListener ();\r
+               listener.Prefixes.Add (uri);\r
+               listener.Start ();\r
+\r
+               try {\r
+                       for (var i = 0; i < 10; i++) {\r
+                               var request = WebRequest.CreateHttp (uri);\r
+                               request.Method = "GET";\r
+\r
+                               var tokenSource = new CancellationTokenSource ();\r
+                               tokenSource.Token.Register(() => request.Abort ());\r
+\r
+                               var responseTask = request.GetResponseAsync ();\r
+\r
+                               var context = listener.GetContext ();\r
+                               byte[] outBuffer = new byte[8 * 1024];\r
+                               context.Response.OutputStream.WriteAsync (outBuffer, 0, outBuffer.Length);\r
+\r
+                               Assert.IsTrue (responseTask.Wait (1000), "Timeout #1");\r
+\r
+                               WebResponse response = responseTask.Result;\r
+                               var stream = response.GetResponseStream ();\r
+\r
+                               byte[] buffer = new byte[8 * 1024];\r
+                               var taskRead = stream.ReadAsync (buffer, 0, buffer.Length, tokenSource.Token);\r
+\r
+                               tokenSource.Cancel ();\r
+\r
+                               Assert.IsTrue (taskRead.Wait (1000), "Timeout #2");\r
+\r
+                               var byteRead = taskRead.Result;\r
+                       }\r
+               } catch (AggregateException ex) {\r
+                       var webEx = ex.InnerException as WebException;\r
+                       Assert.IsNotNull(webEx, "Inner exception is not a WebException");\r
+                       Assert.AreEqual (webEx.Status, WebExceptionStatus.RequestCanceled);\r
+               }\r
+\r
+               listener.Close ();\r
+       }\r
 }\r
 \r
 }\r
index d246173c20400c0b9202d7e5da51a3a7b685ad74..906ca8c134351b40784e79b5d6f46fdc4a4f3df9 100644 (file)
@@ -11,11 +11,9 @@ System.Diagnostics/FileVersionInfo.cs
 System.Diagnostics/MonitoringDescriptionAttribute.cs
 System.Diagnostics/Process.cs
 System.Diagnostics/ProcessModule.cs
-System.Diagnostics/ProcessModuleCollection.cs
 System.Diagnostics/ProcessPriorityClass.cs
 System.Diagnostics/ProcessStartInfo.cs
 System.Diagnostics/ProcessThread.cs
-System.Diagnostics/ProcessThreadCollection.cs
 System.Diagnostics/ProcessWindowStyle.cs
 System.Diagnostics/Stopwatch.cs
 System.Diagnostics/ThreadPriorityLevel.cs
@@ -28,6 +26,7 @@ System.IO.Compression/DeflateStream.cs
 System.IO.Compression/GZipStream.cs
 System.IO/InternalBufferOverflowException.cs
 System.IO/InvalidDataException.cs
+System.IO/IODescriptionAttribute.cs
 System.IO/ErrorEventArgs.cs
 System.IO/ErrorEventHandler.cs
 System.IO/FileSystemEventArgs.cs
@@ -130,6 +129,7 @@ System.Net.Sockets/SafeSocketHandle.cs
 ../referencesource/System/net/System/Net/Sockets/SelectMode.cs
 System.Net.Sockets/SendPacketsElement.cs
 System.Net.Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
 System.Net.Sockets/SocketAsyncResult.cs
@@ -173,6 +173,7 @@ System.Net/HttpListenerContext.cs
 System.Net/HttpListenerPrefixCollection.cs
 System.Net/HttpListenerRequest.cs
 System.Net/HttpListenerResponse.cs
+System.Net/HttpListenerResponseHelper.cs
 System.Net/HttpListenerTimeoutManager.cs
 System.Net/HttpRequestCreator.cs
 System.Net/HttpStreamAsyncResult.cs
@@ -227,7 +228,6 @@ System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicy.cs
 System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs
 System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs
 System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs
-System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs
 System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs
@@ -705,6 +705,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/_ProxyChain.cs
 ../referencesource/System/net/System/Net/_ScatterGatherBuffers.cs
 ../referencesource/System/net/System/Net/_Semaphore.cs
+../referencesource/System/net/System/Net/_ServiceNameStore.cs
 ../referencesource/System/net/System/Net/_TimerThread.cs
 ../referencesource/System/net/System/Net/_WebProxyDataBuilder.cs
 ../referencesource/System/net/System/Net/AuthenticationScheme.cs
@@ -828,6 +829,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
 
 ../referencesource/System/security/system/security/Authentication/ExtendedProtection/TokenBinding.cs
+../referencesource/System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
 
 ../referencesource/System/security/system/security/cryptography/oid.cs
 
@@ -835,6 +837,9 @@ ReferenceSources/Win32Exception.cs
 
 ../referencesource/System/security/system/security/permissions/typedescriptorpermission.cs
 
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
+
 ../referencesource/System/services/timers/system/timers/ElapsedEventHandler.cs
 ../referencesource/System/services/timers/system/timers/Timer.cs
 ../referencesource/System/services/timers/system/timers/TimersDescriptionAttribute.cs
diff --git a/mcs/class/System/monotouch_watch_System.dll.exclude.sources b/mcs/class/System/monotouch_watch_System.dll.exclude.sources
new file mode 100644 (file)
index 0000000..ce4674b
--- /dev/null
@@ -0,0 +1,27 @@
+Mono.Net.Security/LegacySslStream.cs
+Mono.Net.Security/MonoLegacyTlsProvider.cs
+System.Net.Mail/SmtpClient.cs
+System.Net.Sockets/TcpClient.cs
+System.Net.Sockets/TcpListener.cs
+System.Net.Sockets/UdpClient.cs
+System.Net.WebSockets/ClientWebSocket.cs
+System.Net/ChunkedInputStream.cs
+System.Net/EndPointListener.cs
+System.Net/EndPointManager.cs
+System.Net/FtpAsyncResult.cs
+System.Net/FtpDataStream.cs
+System.Net/FtpRequestCreator.cs
+System.Net/FtpRequestCreator.cs
+System.Net/FtpStatus.cs
+System.Net/FtpWebRequest.cs
+System.Net/FtpWebResponse.cs
+System.Net/HttpConnection.cs
+System.Net/HttpListener.cs
+System.Net/HttpListenerContext.cs
+System.Net/HttpListenerPrefixCollection.cs
+System.Net/HttpListenerRequest.cs
+System.Net/HttpListenerResponse.cs
+System.Net/HttpWebRequest.cs
+System.Net/HttpWebResponse.cs
+System.Net/ListenerAsyncResult.cs
+System.Net/ResponseStream.cs
index 7c0bd5983a519e8499a57c6c30b9be525658c105..b606c440802b9f3cb95c43e630fa82760982f681 100644 (file)
@@ -1 +1,16 @@
 #include monotouch_System.dll.sources
+System.Net.Mail/SmtpClient.platformnotsupported.cs
+System.Net.Sockets/TcpClient.platformnotsupported.cs
+System.Net.Sockets/TcpListener.platformnotsupported.cs
+System.Net.Sockets/UdpClient.platformnotsupported.cs
+System.Net.WebSockets/ClientWebSocket.platformnotsupported.cs
+System.Net/FtpRequestCreator.platformnotsupported.cs
+System.Net/FtpWebRequest.platformnotsupported.cs
+System.Net/FtpWebResponse.platformnotsupported.cs
+System.Net/HttpListener.platformnotsupported.cs
+System.Net/HttpListenerContext.platformnotsupported.cs
+System.Net/HttpListenerPrefixCollection.platformnotsupported.cs
+System.Net/HttpListenerRequest.platformnotsupported.cs
+System.Net/HttpListenerResponse.platformnotsupported.cs
+System.Net/HttpWebRequest.platformnotsupported.cs
+System.Net/HttpWebResponse.platformnotsupported.cs
diff --git a/mcs/class/corlib/Documentation/s b/mcs/class/corlib/Documentation/s
deleted file mode 100644 (file)
index aa4de65..0000000
+++ /dev/null
@@ -1,1374 +0,0 @@
-?      s
-?      en/System.Collections.Concurrent
-?      en/ns-System.Threading.Tasks.xml
-?      en/ns-System.Collections.Concurrent.xml
-?      en/ns-System.Diagnostics.Contracts.xml
-?      en/System.Threading.Tasks
-?      en/ns-.xml
-?      en/System.Diagnostics.Contracts.Internal
-?      en/ns-System.Diagnostics.Contracts.Internal.xml
-?      en/System.Diagnostics.Contracts
-M      en/System.Runtime.InteropServices.Expando/IExpando.xml
-?      en/System.Runtime.Versioning/TargetFrameworkAttribute.xml
-M      en/System.Runtime.Versioning/ResourceScope.xml
-M      en/System.Runtime.Versioning/VersioningHelper.xml
-M      en/System.Runtime.Versioning/ResourceExposureAttribute.xml
-M      en/System.Runtime.Versioning/ResourceConsumptionAttribute.xml
-?      en/System.Threading/CountdownEvent.xml
-?      en/System.Threading/CancellationTokenRegistration.xml
-?      en/System.Threading/SpinWait.xml
-?      en/System.Threading/ThreadLocal`1.xml
-?      en/System.Threading/SemaphoreSlim.xml
-?      en/System.Threading/SpinLock.xml
-?      en/System.Threading/LazyInitializer.xml
-?      en/System.Threading/SemaphoreFullException.xml
-?      en/System.Threading/LazyThreadSafetyMode.xml
-?      en/System.Threading/CancellationToken.xml
-?      en/System.Threading/LockRecursionException.xml
-?      en/System.Threading/ManualResetEventSlim.xml
-?      en/System.Threading/CancellationTokenSource.xml
-M      en/System.Threading/WaitHandle.xml
-M      en/System.Threading/WaitCallback.xml
-M      en/System.Threading/EventWaitHandle.xml
-M      en/System.Threading/LockCookie.xml
-M      en/System.Threading/SynchronizationLockException.xml
-M      en/System.Threading/EventResetMode.xml
-M      en/System.Threading/RegisteredWaitHandle.xml
-M      en/System.Threading/ThreadPool.xml
-M      en/System.Threading/Overlapped.xml
-M      en/System.Threading/HostExecutionContextManager.xml
-M      en/System.Threading/ParameterizedThreadStart.xml
-M      en/System.Threading/ThreadStartException.xml
-M      en/System.Threading/SynchronizationContext.xml
-M      en/System.Threading/AsyncFlowControl.xml
-M      en/System.Threading/HostExecutionContext.xml
-M      en/System.Threading/Thread.xml
-M      en/System.Threading/ExecutionContext.xml
-M      en/System.Threading/ThreadState.xml
-M      en/System.Threading/ThreadPriority.xml
-M      en/System.Threading/ThreadInterruptedException.xml
-M      en/System.Threading/IOCompletionCallback.xml
-M      en/System.Threading/Timer.xml
-M      en/System.Threading/ManualResetEvent.xml
-M      en/System.Threading/WaitOrTimerCallback.xml
-M      en/System.Threading/ThreadStart.xml
-M      en/System.Threading/Timeout.xml
-M      en/System.Threading/Monitor.xml
-M      en/System.Threading/ThreadStateException.xml
-M      en/System.Threading/CompressedStack.xml
-M      en/System.Threading/ApartmentState.xml
-M      en/System.Threading/TimerCallback.xml
-M      en/System.Threading/ContextCallback.xml
-M      en/System.Threading/Mutex.xml
-M      en/System.Threading/Interlocked.xml
-M      en/System.Threading/WaitHandleCannotBeOpenedException.xml
-M      en/System.Threading/ReaderWriterLock.xml
-M      en/System.Threading/NativeOverlapped.xml
-M      en/System.Threading/SendOrPostCallback.xml
-M      en/System.Threading/AbandonedMutexException.xml
-M      en/System.Threading/AutoResetEvent.xml
-M      en/System.Threading/ThreadAbortException.xml
-M      en/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.xml
-?      en/System.Security/SecurityContextSource.xml
-?      en/System.Security/SecurityRulesAttribute.xml
-?      en/System.Security/SecurityRuleSet.xml
-?      en/System.Security/SecurityState.xml
-M      en/System.Security/SecurityElement.xml
-M      en/System.Security/IEvidenceFactory.xml
-M      en/System.Security/SecurityException.xml
-M      en/System.Security/XmlSyntaxException.xml
-M      en/System.Security/PolicyLevelType.xml
-M      en/System.Security/UnverifiableCodeAttribute.xml
-M      en/System.Security/IStackWalk.xml
-M      en/System.Security/ISecurityPolicyEncodable.xml
-M      en/System.Security/HostSecurityManager.xml
-M      en/System.Security/IPermission.xml
-M      en/System.Security/VerificationException.xml
-M      en/System.Security/SecurityManager.xml
-M      en/System.Security/HostProtectionException.xml
-M      en/System.Security/SecurityZone.xml
-M      en/System.Security/PermissionSet.xml
-M      en/System.Security/CodeAccessPermission.xml
-M      en/System.Security/AllowPartiallyTrustedCallersAttribute.xml
-M      en/System.Security/SecuritySafeCriticalAttribute.xml
-M      en/System.Security/SecurityCriticalAttribute.xml
-M      en/System.Security/NamedPermissionSet.xml
-M      en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml
-M      en/System.Security/SecurityContext.xml
-M      en/System.Security/HostSecurityManagerOptions.xml
-M      en/System.Security/SecurityCriticalScope.xml
-M      en/System.Security/SecureString.xml
-M      en/System.Security/ISecurityEncodable.xml
-M      en/System.Security/SecurityTransparentAttribute.xml
-M      en/System.Security/SecurityTreatAsSafeAttribute.xml
-?      en/System.Security.AccessControl/ObjectSecurity`1.xml
-M      en/System.Security.AccessControl/ObjectAccessRule.xml
-M      en/System.Security.AccessControl/RegistryAccessRule.xml
-M      en/System.Security.AccessControl/MutexRights.xml
-M      en/System.Security.AccessControl/CustomAce.xml
-M      en/System.Security.AccessControl/DirectoryObjectSecurity.xml
-M      en/System.Security.AccessControl/GenericAce.xml
-M      en/System.Security.AccessControl/RegistryRights.xml
-M      en/System.Security.AccessControl/MutexSecurity.xml
-M      en/System.Security.AccessControl/AceQualifier.xml
-M      en/System.Security.AccessControl/AceEnumerator.xml
-M      en/System.Security.AccessControl/GenericAcl.xml
-M      en/System.Security.AccessControl/EventWaitHandleAccessRule.xml
-M      en/System.Security.AccessControl/ObjectSecurity.xml
-M      en/System.Security.AccessControl/FileSystemAccessRule.xml
-M      en/System.Security.AccessControl/RegistrySecurity.xml
-M      en/System.Security.AccessControl/EventWaitHandleRights.xml
-M      en/System.Security.AccessControl/SystemAcl.xml
-M      en/System.Security.AccessControl/AuthorizationRuleCollection.xml
-M      en/System.Security.AccessControl/AccessControlType.xml
-M      en/System.Security.AccessControl/FileSystemRights.xml
-M      en/System.Security.AccessControl/SecurityInfos.xml
-M      en/System.Security.AccessControl/CommonObjectSecurity.xml
-M      en/System.Security.AccessControl/RawAcl.xml
-M      en/System.Security.AccessControl/AccessControlSections.xml
-M      en/System.Security.AccessControl/EventWaitHandleSecurity.xml
-M      en/System.Security.AccessControl/FileSystemSecurity.xml
-M      en/System.Security.AccessControl/CommonSecurityDescriptor.xml
-M      en/System.Security.AccessControl/CryptoKeySecurity.xml
-M      en/System.Security.AccessControl/PrivilegeNotHeldException.xml
-M      en/System.Security.AccessControl/AccessControlActions.xml
-M      en/System.Security.AccessControl/RegistryAuditRule.xml
-M      en/System.Security.AccessControl/AuthorizationRule.xml
-M      en/System.Security.AccessControl/AccessControlModification.xml
-M      en/System.Security.AccessControl/ResourceType.xml
-M      en/System.Security.AccessControl/AccessRule.xml
-M      en/System.Security.AccessControl/DirectorySecurity.xml
-M      en/System.Security.AccessControl/CompoundAceType.xml
-M      en/System.Security.AccessControl/DiscretionaryAcl.xml
-M      en/System.Security.AccessControl/CommonAce.xml
-M      en/System.Security.AccessControl/FileSystemAuditRule.xml
-M      en/System.Security.AccessControl/AceFlags.xml
-M      en/System.Security.AccessControl/CommonAcl.xml
-M      en/System.Security.AccessControl/ObjectAce.xml
-M      en/System.Security.AccessControl/AuditFlags.xml
-M      en/System.Security.AccessControl/ObjectAceFlags.xml
-M      en/System.Security.AccessControl/CompoundAce.xml
-M      en/System.Security.AccessControl/CryptoKeyAccessRule.xml
-M      en/System.Security.AccessControl/KnownAce.xml
-M      en/System.Security.AccessControl/InheritanceFlags.xml
-M      en/System.Security.AccessControl/CryptoKeyAuditRule.xml
-M      en/System.Security.AccessControl/CryptoKeyRights.xml
-M      en/System.Security.AccessControl/QualifiedAce.xml
-M      en/System.Security.AccessControl/RawSecurityDescriptor.xml
-M      en/System.Security.AccessControl/MutexAuditRule.xml
-M      en/System.Security.AccessControl/ObjectAuditRule.xml
-M      en/System.Security.AccessControl/AceType.xml
-M      en/System.Security.AccessControl/ControlFlags.xml
-M      en/System.Security.AccessControl/AuditRule.xml
-M      en/System.Security.AccessControl/PropagationFlags.xml
-M      en/System.Security.AccessControl/EventWaitHandleAuditRule.xml
-M      en/System.Security.AccessControl/GenericSecurityDescriptor.xml
-M      en/System.Security.AccessControl/NativeObjectSecurity.xml
-M      en/System.Security.AccessControl/FileSecurity.xml
-M      en/System.Security.AccessControl/MutexAccessRule.xml
-M      en/System.Security.Permissions/PublisherIdentityPermission.xml
-M      en/System.Security.Permissions/SecurityPermission.xml
-M      en/System.Security.Permissions/KeyContainerPermissionFlags.xml
-M      en/System.Security.Permissions/RegistryPermission.xml
-M      en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml
-M      en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml
-M      en/System.Security.Permissions/PermissionState.xml
-M      en/System.Security.Permissions/IsolatedStorageContainment.xml
-M      en/System.Security.Permissions/PrincipalPermission.xml
-M      en/System.Security.Permissions/FileDialogPermissionAttribute.xml
-M      en/System.Security.Permissions/HostProtectionResource.xml
-M      en/System.Security.Permissions/ReflectionPermissionFlag.xml
-M      en/System.Security.Permissions/ZoneIdentityPermission.xml
-M      en/System.Security.Permissions/EnvironmentPermissionAccess.xml
-M      en/System.Security.Permissions/EnvironmentPermissionAttribute.xml
-M      en/System.Security.Permissions/GacIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/FileIOPermissionAccess.xml
-M      en/System.Security.Permissions/PublisherIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/KeyContainerPermission.xml
-M      en/System.Security.Permissions/SecurityPermissionAttribute.xml
-M      en/System.Security.Permissions/SecurityAction.xml
-M      en/System.Security.Permissions/CodeAccessSecurityAttribute.xml
-M      en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/SecurityPermissionFlag.xml
-M      en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/EnvironmentPermission.xml
-M      en/System.Security.Permissions/GacIdentityPermission.xml
-M      en/System.Security.Permissions/PrincipalPermissionAttribute.xml
-M      en/System.Security.Permissions/UIPermissionWindow.xml
-M      en/System.Security.Permissions/FileIOPermission.xml
-M      en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml
-M      en/System.Security.Permissions/KeyContainerPermissionAccessEntryCollection.xml
-M      en/System.Security.Permissions/StrongNamePublicKeyBlob.xml
-M      en/System.Security.Permissions/UrlIdentityPermission.xml
-M      en/System.Security.Permissions/UIPermission.xml
-M      en/System.Security.Permissions/ReflectionPermissionAttribute.xml
-M      en/System.Security.Permissions/SiteIdentityPermission.xml
-M      en/System.Security.Permissions/PermissionSetAttribute.xml
-M      en/System.Security.Permissions/KeyContainerPermissionAttribute.xml
-M      en/System.Security.Permissions/FileDialogPermissionAccess.xml
-M      en/System.Security.Permissions/SecurityAttribute.xml
-M      en/System.Security.Permissions/IUnrestrictedPermission.xml
-M      en/System.Security.Permissions/StrongNameIdentityPermission.xml
-M      en/System.Security.Permissions/IsolatedStoragePermission.xml
-M      en/System.Security.Permissions/IsolatedStorageFilePermission.xml
-M      en/System.Security.Permissions/ReflectionPermission.xml
-M      en/System.Security.Permissions/RegistryPermissionAccess.xml
-M      en/System.Security.Permissions/FileIOPermissionAttribute.xml
-M      en/System.Security.Permissions/RegistryPermissionAttribute.xml
-M      en/System.Security.Permissions/UIPermissionClipboard.xml
-M      en/System.Security.Permissions/KeyContainerPermissionAccessEntry.xml
-M      en/System.Security.Permissions/FileDialogPermission.xml
-M      en/System.Security.Permissions/HostProtectionAttribute.xml
-M      en/System.Security.Permissions/KeyContainerPermissionAccessEntryEnumerator.xml
-M      en/System.Security.Permissions/UIPermissionAttribute.xml
-M      en/System.Runtime.Remoting.Messaging/CallContext.xml
-M      en/System.Runtime.Remoting.Messaging/IRemotingFormatter.xml
-M      en/System.Runtime.Remoting.Messaging/RemotingSurrogateSelector.xml
-M      en/System.Runtime.Remoting.Messaging/InternalMessageWrapper.xml
-M      en/System.Runtime.Remoting.Messaging/IMessageSink.xml
-M      en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml
-M      en/System.Runtime.Remoting.Messaging/MethodCallMessageWrapper.xml
-M      en/System.Runtime.Remoting.Messaging/ReturnMessage.xml
-M      en/System.Runtime.Remoting.Messaging/HeaderHandler.xml
-M      en/System.Runtime.Remoting.Messaging/ConstructionCall.xml
-M      en/System.Runtime.Remoting.Messaging/MessageSurrogateFilter.xml
-M      en/System.Runtime.Remoting.Messaging/MethodReturnMessageWrapper.xml
-M      en/System.Runtime.Remoting.Messaging/OneWayAttribute.xml
-M      en/System.Runtime.Remoting.Messaging/Header.xml
-M      en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml
-M      en/System.Runtime.Remoting.Messaging/IMessage.xml
-M      en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml
-M      en/System.Runtime.Remoting.Messaging/IMethodMessage.xml
-M      en/System.Runtime.Remoting.Messaging/MethodResponse.xml
-M      en/System.Runtime.Remoting.Messaging/ILogicalThreadAffinative.xml
-M      en/System.Runtime.Remoting.Messaging/ConstructionResponse.xml
-M      en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml
-M      en/System.Runtime.Remoting.Messaging/AsyncResult.xml
-M      en/System.Runtime.Remoting.Messaging/MethodCall.xml
-M      en/System.Security.Principal/TokenImpersonationLevel.xml
-M      en/System.Security.Principal/IdentityNotMappedException.xml
-M      en/System.Security.Principal/WellKnownSidType.xml
-M      en/System.Security.Principal/IdentityReferenceCollection.xml
-M      en/System.Security.Principal/GenericIdentity.xml
-M      en/System.Security.Principal/IPrincipal.xml
-M      en/System.Security.Principal/WindowsPrincipal.xml
-M      en/System.Security.Principal/NTAccount.xml
-M      en/System.Security.Principal/PrincipalPolicy.xml
-M      en/System.Security.Principal/IIdentity.xml
-M      en/System.Security.Principal/WindowsBuiltInRole.xml
-M      en/System.Security.Principal/WindowsIdentity.xml
-M      en/System.Security.Principal/WindowsImpersonationContext.xml
-M      en/System.Security.Principal/IdentityReference.xml
-M      en/System.Security.Principal/WindowsAccountType.xml
-M      en/System.Security.Principal/SecurityIdentifier.xml
-M      en/System.Security.Principal/TokenAccessLevels.xml
-M      en/System.Security.Principal/GenericPrincipal.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolBinder1.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolVariable.xml
-M      en/System.Diagnostics.SymbolStore/SymAddressKind.xml
-M      en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolReader.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolBinder.xml
-M      en/System.Diagnostics.SymbolStore/SymbolToken.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolScope.xml
-M      en/System.Diagnostics.SymbolStore/SymDocumentType.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolWriter.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolDocument.xml
-M      en/System.Diagnostics.SymbolStore/SymLanguageType.xml
-M      en/System.Diagnostics.SymbolStore/ISymbolMethod.xml
-M      en/System.Runtime.Hosting/ApplicationActivator.xml
-M      en/System.Runtime.Hosting/ActivationArguments.xml
-M      en/System.Configuration.Assemblies/AssemblyHash.xml
-M      en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml
-M      en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml
-?      en/Microsoft.Win32.SafeHandles/SafeRegistryHandle.xml
-M      en/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.xml
-M      en/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.xml
-M      en/Microsoft.Win32.SafeHandles/SafeFileHandle.xml
-M      en/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.xml
-M      en/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.xml
-M      en/Microsoft.Win32.SafeHandles/SafeWaitHandle.xml
-?      en/System.Runtime.Serialization/SafeSerializationEventArgs.xml
-?      en/System.Runtime.Serialization/ISafeSerializationData.xml
-M      en/System.Runtime.Serialization/ISerializationSurrogate.xml
-M      en/System.Runtime.Serialization/StreamingContextStates.xml
-M      en/System.Runtime.Serialization/OnDeserializedAttribute.xml
-M      en/System.Runtime.Serialization/ISurrogateSelector.xml
-M      en/System.Runtime.Serialization/SerializationInfo.xml
-M      en/System.Runtime.Serialization/ObjectIDGenerator.xml
-M      en/System.Runtime.Serialization/FormatterConverter.xml
-M      en/System.Runtime.Serialization/SerializationInfoEnumerator.xml
-M      en/System.Runtime.Serialization/SerializationException.xml
-M      en/System.Runtime.Serialization/IObjectReference.xml
-M      en/System.Runtime.Serialization/StreamingContext.xml
-M      en/System.Runtime.Serialization/SerializationEntry.xml
-M      en/System.Runtime.Serialization/SerializationObjectManager.xml
-M      en/System.Runtime.Serialization/OnSerializingAttribute.xml
-M      en/System.Runtime.Serialization/ObjectManager.xml
-M      en/System.Runtime.Serialization/SerializationBinder.xml
-M      en/System.Runtime.Serialization/Formatter.xml
-M      en/System.Runtime.Serialization/IFormatterConverter.xml
-M      en/System.Runtime.Serialization/FormatterServices.xml
-M      en/System.Runtime.Serialization/OnDeserializingAttribute.xml
-M      en/System.Runtime.Serialization/OnSerializedAttribute.xml
-M      en/System.Runtime.Serialization/IFormatter.xml
-M      en/System.Runtime.Serialization/IDeserializationCallback.xml
-M      en/System.Runtime.Serialization/SurrogateSelector.xml
-M      en/System.Runtime.Serialization/OptionalFieldAttribute.xml
-M      en/System.Runtime.Serialization/ISerializable.xml
-?      en/System/Lazy`1.xml
-?      en/System/Action`3.xml
-?      en/System/Action`5.xml
-?      en/System/Action`7.xml
-?      en/System/Environment+SpecialFolderOption.xml
-?      en/System/TypeAccessException.xml
-?      en/System/Func`1.xml
-?      en/System/Func`3.xml
-?      en/System/Func`5.xml
-?      en/System/Func`7.xml
-?      en/System/Func`9.xml
-?      en/System/Tuple`1.xml
-?      en/System/TimeZoneInfo+TransitionTime.xml
-?      en/System/Tuple`3.xml
-?      en/System/IObservable`1.xml
-?      en/System/Tuple`5.xml
-?      en/System/InsufficientExecutionStackException.xml
-?      en/System/Tuple`7.xml
-?      en/System/TimeZoneInfo+AdjustmentRule.xml
-?      en/System/Action.xml
-?      en/System/Action`2.xml
-?      en/System/Action`4.xml
-?      en/System/Action`6.xml
-?      en/System/Action`8.xml
-?      en/System/IObserver`1.xml
-?      en/System/TimeZoneNotFoundException.xml
-?      en/System/Func`2.xml
-?      en/System/Func`4.xml
-?      en/System/Func`6.xml
-?      en/System/Func`8.xml
-?      en/System/Tuple.xml
-?      en/System/GCNotificationStatus.xml
-?      en/System/TimeZoneInfo.xml
-?      en/System/Tuple`2.xml
-?      en/System/Tuple`4.xml
-?      en/System/Tuple`6.xml
-?      en/System/InvalidTimeZoneException.xml
-?      en/System/Tuple`8.xml
-?      en/System/AggregateException.xml
-M      en/System/UnhandledExceptionEventHandler.xml
-M      en/System/ApplicationException.xml
-M      en/System/UInt32.xml
-M      en/System/InvalidOperationException.xml
-M      en/System/ConsoleKeyInfo.xml
-M      en/System/Activator.xml
-M      en/System/Action`1.xml
-M      en/System/Int32.xml
-M      en/System/TypeLoadException.xml
-M      en/System/LoaderOptimizationAttribute.xml
-M      en/System/ConsoleColor.xml
-M      en/System/Void.xml
-M      en/System/Environment.xml
-M      en/System/NullReferenceException.xml
-M      en/System/Double.xml
-M      en/System/AttributeUsageAttribute.xml
-M      en/System/TypeCode.xml
-M      en/System/Char.xml
-M      en/System/IComparable.xml
-M      en/System/MissingMemberException.xml
-M      en/System/IndexOutOfRangeException.xml
-M      en/System/Convert.xml
-M      en/System/Random.xml
-M      en/System/TimeSpan.xml
-M      en/System/BadImageFormatException.xml
-M      en/System/Predicate`1.xml
-M      en/System/ArrayTypeMismatchException.xml
-M      en/System/Version.xml
-M      en/System/MissingMethodException.xml
-M      en/System/TimeZone.xml
-M      en/System/Comparison`1.xml
-M      en/System/MTAThreadAttribute.xml
-M      en/System/AttributeTargets.xml
-M      en/System/InsufficientMemoryException.xml
-M      en/System/StringComparer.xml
-M      en/System/ContextBoundObject.xml
-M      en/System/DateTimeOffset.xml
-M      en/System/OutOfMemoryException.xml
-M      en/System/TimeoutException.xml
-M      en/System/ActivationContext.xml
-M      en/System/TypeInitializationException.xml
-M      en/System/MulticastNotSupportedException.xml
-M      en/System/ObjectDisposedException.xml
-M      en/System/OverflowException.xml
-M      en/System/ParamArrayAttribute.xml
-M      en/System/IServiceProvider.xml
-M      en/System/IAsyncResult.xml
-M      en/System/ResolveEventArgs.xml
-M      en/System/IAppDomainSetup.xml
-M      en/System/RuntimeFieldHandle.xml
-M      en/System/SystemException.xml
-M      en/System/ConsoleModifiers.xml
-M      en/System/_AppDomain.xml
-M      en/System/ExecutionEngineException.xml
-M      en/System/ArithmeticException.xml
-M      en/System/RankException.xml
-M      en/System/Environment+SpecialFolder.xml
-M      en/System/ConsoleSpecialKey.xml
-M      en/System/EventHandler.xml
-M      en/System/Boolean.xml
-M      en/System/InvalidCastException.xml
-M      en/System/Guid.xml
-M      en/System/PlatformNotSupportedException.xml
-M      en/System/MissingFieldException.xml
-M      en/System/OperatingSystem.xml
-M      en/System/AssemblyLoadEventArgs.xml
-M      en/System/ObsoleteAttribute.xml
-M      en/System/MulticastDelegate.xml
-M      en/System/EventHandler`1.xml
-M      en/System/RuntimeMethodHandle.xml
-M      en/System/PlatformID.xml
-M      en/System/AppDomainUnloadedException.xml
-M      en/System/Byte.xml
-M      en/System/Enum.xml
-M      en/System/UIntPtr.xml
-M      en/System/BitConverter.xml
-M      en/System/CrossAppDomainDelegate.xml
-M      en/System/FlagsAttribute.xml
-M      en/System/DBNull.xml
-M      en/System/ArraySegment`1.xml
-M      en/System/ArgIterator.xml
-M      en/System/FieldAccessException.xml
-M      en/System/Math.xml
-M      en/System/NonSerializedAttribute.xml
-M      en/System/SerializableAttribute.xml
-M      en/System/DateTime.xml
-M      en/System/Exception.xml
-M      en/System/OperationCanceledException.xml
-M      en/System/ThreadStaticAttribute.xml
-M      en/System/DllNotFoundException.xml
-M      en/System/AppDomain.xml
-M      en/System/StackOverflowException.xml
-M      en/System/GCCollectionMode.xml
-M      en/System/ActivationContext+ContextForm.xml
-M      en/System/Delegate.xml
-M      en/System/ApplicationId.xml
-M      en/System/EnvironmentVariableTarget.xml
-M      en/System/Single.xml
-M      en/System/UnauthorizedAccessException.xml
-M      en/System/NotSupportedException.xml
-M      en/System/InvalidProgramException.xml
-M      en/System/ICloneable.xml
-M      en/System/StringSplitOptions.xml
-M      en/System/ModuleHandle.xml
-M      en/System/RuntimeTypeHandle.xml
-M      en/System/StringComparison.xml
-M      en/System/Console.xml
-M      en/System/DateTimeKind.xml
-M      en/System/NotImplementedException.xml
-M      en/System/MarshalByRefObject.xml
-M      en/System/WeakReference.xml
-M      en/System/ConsoleCancelEventHandler.xml
-M      en/System/ContextMarshalException.xml
-M      en/System/CLSCompliantAttribute.xml
-M      en/System/TypeUnloadedException.xml
-M      en/System/Array.xml
-M      en/System/DayOfWeek.xml
-M      en/System/ValueType.xml
-M      en/System/Nullable`1.xml
-M      en/System/ResolveEventHandler.xml
-M      en/System/ContextStaticAttribute.xml
-M      en/System/MethodAccessException.xml
-M      en/System/Type.xml
-M      en/System/IConvertible.xml
-M      en/System/SByte.xml
-M      en/System/UInt16.xml
-M      en/System/NotFiniteNumberException.xml
-M      en/System/MidpointRounding.xml
-M      en/System/GC.xml
-M      en/System/AppDomainSetup.xml
-M      en/System/AsyncCallback.xml
-M      en/System/ArgumentOutOfRangeException.xml
-M      en/System/ArgumentNullException.xml
-M      en/System/IEquatable`1.xml
-M      en/System/IDisposable.xml
-M      en/System/UnhandledExceptionEventArgs.xml
-M      en/System/Int16.xml
-M      en/System/ArgumentException.xml
-M      en/System/LocalDataStoreSlot.xml
-M      en/System/Attribute.xml
-M      en/System/AppDomainManager.xml
-M      en/System/AccessViolationException.xml
-M      en/System/ICustomFormatter.xml
-M      en/System/IFormattable.xml
-M      en/System/Buffer.xml
-M      en/System/ConsoleKey.xml
-M      en/System/IFormatProvider.xml
-M      en/System/AppDomainInitializer.xml
-M      en/System/LoaderOptimization.xml
-M      en/System/ApplicationIdentity.xml
-M      en/System/AssemblyLoadEventHandler.xml
-M      en/System/CharEnumerator.xml
-M      en/System/IntPtr.xml
-M      en/System/DataMisalignedException.xml
-M      en/System/AppDomainManagerInitializationOptions.xml
-M      en/System/ConsoleCancelEventArgs.xml
-M      en/System/Converter`2.xml
-M      en/System/UInt64.xml
-M      en/System/Base64FormattingOptions.xml
-M      en/System/CannotUnloadAppDomainException.xml
-M      en/System/Nullable.xml
-M      en/System/EventArgs.xml
-M      en/System/Decimal.xml
-M      en/System/IComparable`1.xml
-M      en/System/RuntimeArgumentHandle.xml
-M      en/System/STAThreadAttribute.xml
-M      en/System/Int64.xml
-M      en/System/TypedReference.xml
-M      en/System/DuplicateWaitObjectException.xml
-M      en/System/Object.xml
-M      en/System/String.xml
-M      en/System/FormatException.xml
-M      en/System/EntryPointNotFoundException.xml
-M      en/System/MemberAccessException.xml
-M      en/System/DivideByZeroException.xml
-?      en/System.Runtime.InteropServices/SafeBuffer.xml
-?      en/System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.xml
-M      en/System.Runtime.InteropServices/ExporterEventKind.xml
-M      en/System.Runtime.InteropServices/SafeArrayTypeMismatchException.xml
-M      en/System.Runtime.InteropServices/TypeLibTypeFlags.xml
-M      en/System.Runtime.InteropServices/UCOMIEnumString.xml
-M      en/System.Runtime.InteropServices/InAttribute.xml
-M      en/System.Runtime.InteropServices/_EventInfo.xml
-M      en/System.Runtime.InteropServices/_PropertyInfo.xml
-M      en/System.Runtime.InteropServices/FUNCKIND.xml
-M      en/System.Runtime.InteropServices/BINDPTR.xml
-M      en/System.Runtime.InteropServices/UCOMIEnumConnections.xml
-M      en/System.Runtime.InteropServices/ComCompatibleVersionAttribute.xml
-M      en/System.Runtime.InteropServices/ITypeLibConverter.xml
-M      en/System.Runtime.InteropServices/_ILGenerator.xml
-M      en/System.Runtime.InteropServices/FieldOffsetAttribute.xml
-M      en/System.Runtime.InteropServices/TYPEDESC.xml
-M      en/System.Runtime.InteropServices/_Type.xml
-M      en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml
-M      en/System.Runtime.InteropServices/DefaultCharSetAttribute.xml
-M      en/System.Runtime.InteropServices/ICustomMarshaler.xml
-M      en/System.Runtime.InteropServices/_MemberInfo.xml
-M      en/System.Runtime.InteropServices/ComDefaultInterfaceAttribute.xml
-M      en/System.Runtime.InteropServices/HandleRef.xml
-M      en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml
-M      en/System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.xml
-M      en/System.Runtime.InteropServices/CurrencyWrapper.xml
-M      en/System.Runtime.InteropServices/TypeLibVarFlags.xml
-M      en/System.Runtime.InteropServices/TYPEFLAGS.xml
-M      en/System.Runtime.InteropServices/SafeArrayRankMismatchException.xml
-M      en/System.Runtime.InteropServices/UnknownWrapper.xml
-M      en/System.Runtime.InteropServices/_ConstructorInfo.xml
-M      en/System.Runtime.InteropServices/ComInterfaceType.xml
-M      en/System.Runtime.InteropServices/CALLCONV.xml
-M      en/System.Runtime.InteropServices/TypeLibVersionAttribute.xml
-M      en/System.Runtime.InteropServices/LCIDConversionAttribute.xml
-M      en/System.Runtime.InteropServices/AutomationProxyAttribute.xml
-M      en/System.Runtime.InteropServices/GCHandleType.xml
-M      en/System.Runtime.InteropServices/OptionalAttribute.xml
-M      en/System.Runtime.InteropServices/VarEnum.xml
-M      en/System.Runtime.InteropServices/UCOMIEnumConnectionPoints.xml
-M      en/System.Runtime.InteropServices/IMPLTYPEFLAGS.xml
-M      en/System.Runtime.InteropServices/PreserveSigAttribute.xml
-M      en/System.Runtime.InteropServices/LayoutKind.xml
-M      en/System.Runtime.InteropServices/CONNECTDATA.xml
-M      en/System.Runtime.InteropServices/ObjectCreationDelegate.xml
-M      en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml
-M      en/System.Runtime.InteropServices/ComSourceInterfacesAttribute.xml
-M      en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml
-M      en/System.Runtime.InteropServices/UCOMIBindCtx.xml
-M      en/System.Runtime.InteropServices/SafeHandle.xml
-M      en/System.Runtime.InteropServices/PARAMFLAG.xml
-M      en/System.Runtime.InteropServices/UCOMITypeComp.xml
-M      en/System.Runtime.InteropServices/_Exception.xml
-M      en/System.Runtime.InteropServices/_FieldInfo.xml
-M      en/System.Runtime.InteropServices/TypeLibConverter.xml
-M      en/System.Runtime.InteropServices/ELEMDESC+DESCUNION.xml
-M      en/System.Runtime.InteropServices/_CustomAttributeBuilder.xml
-M      en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml
-M      en/System.Runtime.InteropServices/ComRegisterFunctionAttribute.xml
-M      en/System.Runtime.InteropServices/RegistrationServices.xml
-M      en/System.Runtime.InteropServices/ArrayWithOffset.xml
-M      en/System.Runtime.InteropServices/ICustomAdapter.xml
-M      en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml
-M      en/System.Runtime.InteropServices/DllImportAttribute.xml
-M      en/System.Runtime.InteropServices/OutAttribute.xml
-M      en/System.Runtime.InteropServices/InvalidComObjectException.xml
-M      en/System.Runtime.InteropServices/_ConstructorBuilder.xml
-M      en/System.Runtime.InteropServices/_ParameterInfo.xml
-M      en/System.Runtime.InteropServices/COMException.xml
-M      en/System.Runtime.InteropServices/DispIdAttribute.xml
-M      en/System.Runtime.InteropServices/DispatchWrapper.xml
-M      en/System.Runtime.InteropServices/ExternalException.xml
-M      en/System.Runtime.InteropServices/INVOKEKIND.xml
-M      en/System.Runtime.InteropServices/IDLFLAG.xml
-M      en/System.Runtime.InteropServices/MarshalDirectiveException.xml
-M      en/System.Runtime.InteropServices/StructLayoutAttribute.xml
-M      en/System.Runtime.InteropServices/_Thread.xml
-M      en/System.Runtime.InteropServices/RuntimeEnvironment.xml
-M      en/System.Runtime.InteropServices/ComConversionLossAttribute.xml
-M      en/System.Runtime.InteropServices/UCOMIRunningObjectTable.xml
-M      en/System.Runtime.InteropServices/CallingConvention.xml
-M      en/System.Runtime.InteropServices/_AssemblyName.xml
-M      en/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.xml
-M      en/System.Runtime.InteropServices/EXCEPINFO.xml
-M      en/System.Runtime.InteropServices/SYSKIND.xml
-M      en/System.Runtime.InteropServices/_AssemblyBuilder.xml
-M      en/System.Runtime.InteropServices/UCOMIPersistFile.xml
-M      en/System.Runtime.InteropServices/_TypeBuilder.xml
-M      en/System.Runtime.InteropServices/UCOMIStream.xml
-M      en/System.Runtime.InteropServices/STATSTG.xml
-M      en/System.Runtime.InteropServices/FUNCDESC.xml
-M      en/System.Runtime.InteropServices/_MethodInfo.xml
-M      en/System.Runtime.InteropServices/FILETIME.xml
-M      en/System.Runtime.InteropServices/PARAMDESC.xml
-M      en/System.Runtime.InteropServices/MarshalAsAttribute.xml
-M      en/System.Runtime.InteropServices/_Attribute.xml
-M      en/System.Runtime.InteropServices/DISPPARAMS.xml
-M      en/System.Runtime.InteropServices/UCOMITypeLib.xml
-M      en/System.Runtime.InteropServices/TypeLibVarAttribute.xml
-M      en/System.Runtime.InteropServices/VARFLAGS.xml
-M      en/System.Runtime.InteropServices/VariantWrapper.xml
-M      en/System.Runtime.InteropServices/TypeLibFuncAttribute.xml
-M      en/System.Runtime.InteropServices/ComAliasNameAttribute.xml
-M      en/System.Runtime.InteropServices/TypeLibExporterFlags.xml
-M      en/System.Runtime.InteropServices/ComVisibleAttribute.xml
-M      en/System.Runtime.InteropServices/BIND_OPTS.xml
-M      en/System.Runtime.InteropServices/TYPEKIND.xml
-M      en/System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.xml
-M      en/System.Runtime.InteropServices/IRegistrationServices.xml
-M      en/System.Runtime.InteropServices/VARDESC.xml
-M      en/System.Runtime.InteropServices/_ModuleBuilder.xml
-M      en/System.Runtime.InteropServices/ComImportAttribute.xml
-M      en/System.Runtime.InteropServices/TypeLibFuncFlags.xml
-M      en/System.Runtime.InteropServices/UnmanagedType.xml
-M      en/System.Runtime.InteropServices/TYPELIBATTR.xml
-M      en/System.Runtime.InteropServices/IDLDESC.xml
-M      en/System.Runtime.InteropServices/ProgIdAttribute.xml
-M      en/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.xml
-M      en/System.Runtime.InteropServices/ComMemberType.xml
-M      en/System.Runtime.InteropServices/VARDESC+DESCUNION.xml
-M      en/System.Runtime.InteropServices/_MethodBase.xml
-M      en/System.Runtime.InteropServices/CoClassAttribute.xml
-M      en/System.Runtime.InteropServices/ICustomFactory.xml
-M      en/System.Runtime.InteropServices/IDispatchImplAttribute.xml
-M      en/System.Runtime.InteropServices/ExtensibleClassFactory.xml
-M      en/System.Runtime.InteropServices/ELEMDESC.xml
-M      en/System.Runtime.InteropServices/LIBFLAGS.xml
-M      en/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.xml
-M      en/System.Runtime.InteropServices/_Module.xml
-M      en/System.Runtime.InteropServices/UCOMIEnumVARIANT.xml
-M      en/System.Runtime.InteropServices/_ParameterBuilder.xml
-M      en/System.Runtime.InteropServices/Marshal.xml
-M      en/System.Runtime.InteropServices/_EventBuilder.xml
-M      en/System.Runtime.InteropServices/_FieldBuilder.xml
-M      en/System.Runtime.InteropServices/ErrorWrapper.xml
-M      en/System.Runtime.InteropServices/_Activator.xml
-M      en/System.Runtime.InteropServices/RegistrationConnectionType.xml
-M      en/System.Runtime.InteropServices/IDispatchImplType.xml
-M      en/System.Runtime.InteropServices/SEHException.xml
-M      en/System.Runtime.InteropServices/_LocalBuilder.xml
-M      en/System.Runtime.InteropServices/RegistrationClassContext.xml
-M      en/System.Runtime.InteropServices/GCHandle.xml
-M      en/System.Runtime.InteropServices/UCOMIConnectionPoint.xml
-M      en/System.Runtime.InteropServices/CriticalHandle.xml
-M      en/System.Runtime.InteropServices/FUNCFLAGS.xml
-M      en/System.Runtime.InteropServices/ImporterEventKind.xml
-M      en/System.Runtime.InteropServices/_EnumBuilder.xml
-M      en/System.Runtime.InteropServices/TypeLibImportClassAttribute.xml
-M      en/System.Runtime.InteropServices/_Assembly.xml
-M      en/System.Runtime.InteropServices/DESCKIND.xml
-M      en/System.Runtime.InteropServices/ComEventInterfaceAttribute.xml
-M      en/System.Runtime.InteropServices/_MethodRental.xml
-M      en/System.Runtime.InteropServices/UCOMIEnumMoniker.xml
-M      en/System.Runtime.InteropServices/_MethodBuilder.xml
-M      en/System.Runtime.InteropServices/ClassInterfaceType.xml
-M      en/System.Runtime.InteropServices/CharSet.xml
-M      en/System.Runtime.InteropServices/UCOMITypeInfo.xml
-M      en/System.Runtime.InteropServices/_PropertyBuilder.xml
-M      en/System.Runtime.InteropServices/InvalidOleVariantTypeException.xml
-M      en/System.Runtime.InteropServices/TypeLibTypeAttribute.xml
-M      en/System.Runtime.InteropServices/BestFitMappingAttribute.xml
-M      en/System.Runtime.InteropServices/_SignatureHelper.xml
-M      en/System.Runtime.InteropServices/UCOMIMoniker.xml
-M      en/System.Runtime.InteropServices/TypeLibImporterFlags.xml
-M      en/System.Runtime.InteropServices/UCOMIConnectionPointContainer.xml
-M      en/System.Runtime.InteropServices/BStrWrapper.xml
-M      en/System.Runtime.InteropServices/TYPEATTR.xml
-M      en/System.Runtime.InteropServices/GuidAttribute.xml
-M      en/System.Runtime.Remoting.Activation/ActivatorLevel.xml
-M      en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml
-M      en/System.Runtime.Remoting.Activation/IActivator.xml
-M      en/System.Runtime.Remoting.Activation/UrlAttribute.xml
-M      en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml
-M      en/System.Resources/ResourceManager.xml
-M      en/System.Resources/IResourceReader.xml
-M      en/System.Resources/ResourceSet.xml
-M      en/System.Resources/ResourceWriter.xml
-M      en/System.Resources/UltimateResourceFallbackLocation.xml
-M      en/System.Resources/MissingManifestResourceException.xml
-M      en/System.Resources/ResourceReader.xml
-M      en/System.Resources/IResourceWriter.xml
-M      en/System.Resources/NeutralResourcesLanguageAttribute.xml
-M      en/System.Resources/SatelliteContractVersionAttribute.xml
-M      en/System.Resources/MissingSatelliteAssemblyException.xml
-M      en/System.Runtime.Remoting.Contexts/IContributeClientContextSink.xml
-M      en/System.Runtime.Remoting.Contexts/IContextAttribute.xml
-M      en/System.Runtime.Remoting.Contexts/IContributeDynamicSink.xml
-M      en/System.Runtime.Remoting.Contexts/Context.xml
-M      en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml
-M      en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml
-M      en/System.Runtime.Remoting.Contexts/ContextProperty.xml
-M      en/System.Runtime.Remoting.Contexts/CrossContextDelegate.xml
-M      en/System.Runtime.Remoting.Contexts/IContributeEnvoySink.xml
-M      en/System.Runtime.Remoting.Contexts/IContextProperty.xml
-M      en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml
-M      en/System.Runtime.Remoting.Contexts/IContributeObjectSink.xml
-M      en/System.Runtime.Remoting.Contexts/ContextAttribute.xml
-M      en/System.Runtime.Remoting.Contexts/IContributeServerContextSink.xml
-M      en/System.Runtime.Remoting.Contexts/IContextPropertyActivator.xml
-?      en/System.Collections/StructuralComparisons.xml
-?      en/System.Collections/IStructuralEquatable.xml
-?      en/System.Collections/IStructuralComparable.xml
-M      en/System.Collections/IDictionaryEnumerator.xml
-M      en/System.Collections/IComparer.xml
-M      en/System.Collections/IList.xml
-M      en/System.Collections/Queue.xml
-M      en/System.Collections/ReadOnlyCollectionBase.xml
-M      en/System.Collections/CaseInsensitiveComparer.xml
-M      en/System.Collections/CollectionBase.xml
-M      en/System.Collections/DictionaryEntry.xml
-M      en/System.Collections/IEnumerable.xml
-M      en/System.Collections/IEnumerator.xml
-M      en/System.Collections/Hashtable.xml
-M      en/System.Collections/SortedList.xml
-M      en/System.Collections/IEqualityComparer.xml
-M      en/System.Collections/DictionaryBase.xml
-M      en/System.Collections/IHashCodeProvider.xml
-M      en/System.Collections/ICollection.xml
-M      en/System.Collections/Stack.xml
-M      en/System.Collections/CaseInsensitiveHashCodeProvider.xml
-M      en/System.Collections/Comparer.xml
-M      en/System.Collections/ArrayList.xml
-M      en/System.Collections/BitArray.xml
-M      en/System.Collections/IDictionary.xml
-M      en/System.Runtime.ConstrainedExecution/Consistency.xml
-M      en/System.Runtime.ConstrainedExecution/CriticalFinalizerObject.xml
-M      en/System.Runtime.ConstrainedExecution/Cer.xml
-M      en/System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.xml
-M      en/System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.xml
-M      en/System.Diagnostics.CodeAnalysis/SuppressMessageAttribute.xml
-M      en/System.Reflection.Emit/TypeToken.xml
-M      en/System.Reflection.Emit/MethodRental.xml
-M      en/System.Reflection.Emit/AssemblyBuilder.xml
-M      en/System.Reflection.Emit/TypeBuilder.xml
-M      en/System.Reflection.Emit/OperandType.xml
-M      en/System.Reflection.Emit/OpCodes.xml
-M      en/System.Reflection.Emit/ConstructorBuilder.xml
-M      en/System.Reflection.Emit/PackingSize.xml
-M      en/System.Reflection.Emit/StringToken.xml
-M      en/System.Reflection.Emit/OpCode.xml
-M      en/System.Reflection.Emit/StackBehaviour.xml
-M      en/System.Reflection.Emit/EnumBuilder.xml
-M      en/System.Reflection.Emit/ILGenerator.xml
-M      en/System.Reflection.Emit/ParameterToken.xml
-M      en/System.Reflection.Emit/MethodToken.xml
-M      en/System.Reflection.Emit/EventToken.xml
-M      en/System.Reflection.Emit/FieldToken.xml
-M      en/System.Reflection.Emit/PropertyToken.xml
-M      en/System.Reflection.Emit/DynamicILInfo.xml
-M      en/System.Reflection.Emit/DynamicMethod.xml
-M      en/System.Reflection.Emit/GenericTypeParameterBuilder.xml
-M      en/System.Reflection.Emit/ParameterBuilder.xml
-M      en/System.Reflection.Emit/MethodBuilder.xml
-M      en/System.Reflection.Emit/EventBuilder.xml
-M      en/System.Reflection.Emit/FieldBuilder.xml
-M      en/System.Reflection.Emit/PropertyBuilder.xml
-M      en/System.Reflection.Emit/ModuleBuilder.xml
-M      en/System.Reflection.Emit/PEFileKinds.xml
-M      en/System.Reflection.Emit/SignatureHelper.xml
-M      en/System.Reflection.Emit/LocalBuilder.xml
-M      en/System.Reflection.Emit/SignatureToken.xml
-M      en/System.Reflection.Emit/CustomAttributeBuilder.xml
-M      en/System.Reflection.Emit/UnmanagedMarshal.xml
-M      en/System.Reflection.Emit/AssemblyBuilderAccess.xml
-M      en/System.Reflection.Emit/FlowControl.xml
-M      en/System.Reflection.Emit/OpCodeType.xml
-M      en/System.Reflection.Emit/Label.xml
-M      en/System.Collections.Generic/IEqualityComparer`1.xml
-M      en/System.Collections.Generic/KeyValuePair`2.xml
-M      en/System.Collections.Generic/KeyNotFoundException.xml
-M      en/System.Collections.Generic/ICollection`1.xml
-M      en/System.Collections.Generic/Dictionary`2.xml
-M      en/System.Collections.Generic/Dictionary`2+KeyCollection.xml
-M      en/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml
-M      en/System.Collections.Generic/Comparer`1.xml
-M      en/System.Collections.Generic/List`1.xml
-M      en/System.Collections.Generic/IDictionary`2.xml
-M      en/System.Collections.Generic/IComparer`1.xml
-M      en/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml
-M      en/System.Collections.Generic/Dictionary`2+Enumerator.xml
-M      en/System.Collections.Generic/IList`1.xml
-M      en/System.Collections.Generic/EqualityComparer`1.xml
-M      en/System.Collections.Generic/IEnumerable`1.xml
-M      en/System.Collections.Generic/List`1+Enumerator.xml
-M      en/System.Collections.Generic/IEnumerator`1.xml
-M      en/System.Collections.Generic/Dictionary`2+ValueCollection.xml
-M      en/System.Deployment.Internal/InternalActivationContextHelper.xml
-M      en/System.Deployment.Internal/InternalApplicationIdentityHelper.xml
-?      en/System.Globalization/TimeSpanStyles.xml
-?      en/System.Globalization/CultureNotFoundException.xml
-M      en/System.Globalization/JapaneseCalendar.xml
-M      en/System.Globalization/DateTimeFormatInfo.xml
-M      en/System.Globalization/CalendarAlgorithmType.xml
-M      en/System.Globalization/DaylightTime.xml
-M      en/System.Globalization/UnicodeCategory.xml
-M      en/System.Globalization/IdnMapping.xml
-M      en/System.Globalization/HijriCalendar.xml
-M      en/System.Globalization/CultureInfo.xml
-M      en/System.Globalization/TextElementEnumerator.xml
-M      en/System.Globalization/KoreanLunisolarCalendar.xml
-M      en/System.Globalization/DigitShapes.xml
-M      en/System.Globalization/TaiwanLunisolarCalendar.xml
-M      en/System.Globalization/GregorianCalendar.xml
-M      en/System.Globalization/KoreanCalendar.xml
-M      en/System.Globalization/JapaneseLunisolarCalendar.xml
-M      en/System.Globalization/TaiwanCalendar.xml
-M      en/System.Globalization/CalendarWeekRule.xml
-M      en/System.Globalization/UmAlQuraCalendar.xml
-M      en/System.Globalization/StringInfo.xml
-M      en/System.Globalization/PersianCalendar.xml
-M      en/System.Globalization/EastAsianLunisolarCalendar.xml
-M      en/System.Globalization/NumberStyles.xml
-M      en/System.Globalization/GregorianCalendarTypes.xml
-M      en/System.Globalization/RegionInfo.xml
-M      en/System.Globalization/SortKey.xml
-M      en/System.Globalization/CharUnicodeInfo.xml
-M      en/System.Globalization/DateTimeStyles.xml
-M      en/System.Globalization/TextInfo.xml
-M      en/System.Globalization/ChineseLunisolarCalendar.xml
-M      en/System.Globalization/CompareInfo.xml
-M      en/System.Globalization/CompareOptions.xml
-M      en/System.Globalization/HebrewCalendar.xml
-M      en/System.Globalization/ThaiBuddhistCalendar.xml
-M      en/System.Globalization/CultureTypes.xml
-M      en/System.Globalization/Calendar.xml
-M      en/System.Globalization/JulianCalendar.xml
-M      en/System.Globalization/NumberFormatInfo.xml
-M      en/System.Runtime.Remoting.Channels/IClientChannelSinkProvider.xml
-M      en/System.Runtime.Remoting.Channels/IChannel.xml
-M      en/System.Runtime.Remoting.Channels/ClientChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/IChannelSender.xml
-M      en/System.Runtime.Remoting.Channels/IServerChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/IChannelReceiverHook.xml
-M      en/System.Runtime.Remoting.Channels/TransportHeaders.xml
-M      en/System.Runtime.Remoting.Channels/IChannelDataStore.xml
-M      en/System.Runtime.Remoting.Channels/IClientChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/IServerChannelSink.xml
-M      en/System.Runtime.Remoting.Channels/IClientFormatterSink.xml
-M      en/System.Runtime.Remoting.Channels/ITransportHeaders.xml
-M      en/System.Runtime.Remoting.Channels/BaseChannelSinkWithProperties.xml
-M      en/System.Runtime.Remoting.Channels/IChannelSinkBase.xml
-M      en/System.Runtime.Remoting.Channels/IServerResponseChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/BaseChannelObjectWithProperties.xml
-M      en/System.Runtime.Remoting.Channels/IServerFormatterSinkProvider.xml
-M      en/System.Runtime.Remoting.Channels/ServerProcessing.xml
-M      en/System.Runtime.Remoting.Channels/IClientChannelSink.xml
-M      en/System.Runtime.Remoting.Channels/IChannelReceiver.xml
-M      en/System.Runtime.Remoting.Channels/ISecurableChannel.xml
-M      en/System.Runtime.Remoting.Channels/IServerChannelSinkProvider.xml
-M      en/System.Runtime.Remoting.Channels/SinkProviderData.xml
-M      en/System.Runtime.Remoting.Channels/IClientResponseChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/ServerChannelSinkStack.xml
-M      en/System.Runtime.Remoting.Channels/IClientFormatterSinkProvider.xml
-M      en/System.Runtime.Remoting.Channels/ChannelServices.xml
-M      en/System.Runtime.Remoting.Channels/BaseChannelWithProperties.xml
-M      en/System.Runtime.Remoting.Channels/ChannelDataStore.xml
-M      en/System.Collections.ObjectModel/ReadOnlyCollection`1.xml
-M      en/System.Collections.ObjectModel/Collection`1.xml
-M      en/System.Collections.ObjectModel/KeyedCollection`2.xml
-M      en/System.Diagnostics/StackFrame.xml
-M      en/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml
-M      en/System.Diagnostics/Debugger.xml
-M      en/System.Diagnostics/DebuggerHiddenAttribute.xml
-M      en/System.Diagnostics/StackTrace.xml
-M      en/System.Diagnostics/DebuggerBrowsableState.xml
-M      en/System.Diagnostics/DebuggerVisualizerAttribute.xml
-M      en/System.Diagnostics/ConditionalAttribute.xml
-M      en/System.Diagnostics/DebuggerDisplayAttribute.xml
-M      en/System.Diagnostics/DebuggableAttribute.xml
-M      en/System.Diagnostics/DebuggerStepThroughAttribute.xml
-M      en/System.Diagnostics/DebuggerBrowsableAttribute.xml
-M      en/System.Diagnostics/DebuggerTypeProxyAttribute.xml
-M      en/System.Diagnostics/DebuggerNonUserCodeAttribute.xml
-M      en/System.Diagnostics/DebuggerStepperBoundaryAttribute.xml
-M      en/System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.xml
-M      en/System.Runtime.InteropServices.ComTypes/EXCEPINFO.xml
-M      en/System.Runtime.InteropServices.ComTypes/ELEMDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/CONNECTDATA.xml
-M      en/System.Runtime.InteropServices.ComTypes/LIBFLAGS.xml
-M      en/System.Runtime.InteropServices.ComTypes/SYSKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.xml
-M      en/System.Runtime.InteropServices.ComTypes/ITypeInfo2.xml
-M      en/System.Runtime.InteropServices.ComTypes/IRunningObjectTable.xml
-M      en/System.Runtime.InteropServices.ComTypes/STATSTG.xml
-M      en/System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.xml
-M      en/System.Runtime.InteropServices.ComTypes/FUNCDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/PARAMFLAG.xml
-M      en/System.Runtime.InteropServices.ComTypes/FILETIME.xml
-M      en/System.Runtime.InteropServices.ComTypes/PARAMDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/FUNCKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/IPersistFile.xml
-M      en/System.Runtime.InteropServices.ComTypes/IEnumVARIANT.xml
-M      en/System.Runtime.InteropServices.ComTypes/BINDPTR.xml
-M      en/System.Runtime.InteropServices.ComTypes/DISPPARAMS.xml
-M      en/System.Runtime.InteropServices.ComTypes/ITypeLib2.xml
-M      en/System.Runtime.InteropServices.ComTypes/IStream.xml
-M      en/System.Runtime.InteropServices.ComTypes/IEnumString.xml
-M      en/System.Runtime.InteropServices.ComTypes/ELEMDESC+DESCUNION.xml
-M      en/System.Runtime.InteropServices.ComTypes/IBindCtx.xml
-M      en/System.Runtime.InteropServices.ComTypes/VARFLAGS.xml
-M      en/System.Runtime.InteropServices.ComTypes/FUNCFLAGS.xml
-M      en/System.Runtime.InteropServices.ComTypes/ITypeComp.xml
-M      en/System.Runtime.InteropServices.ComTypes/IEnumConnections.xml
-M      en/System.Runtime.InteropServices.ComTypes/TYPEDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/BIND_OPTS.xml
-M      en/System.Runtime.InteropServices.ComTypes/ITypeLib.xml
-M      en/System.Runtime.InteropServices.ComTypes/IConnectionPoint.xml
-M      en/System.Runtime.InteropServices.ComTypes/DESCKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/TYPEKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/VARDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/TYPEFLAGS.xml
-M      en/System.Runtime.InteropServices.ComTypes/VARKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/INVOKEKIND.xml
-M      en/System.Runtime.InteropServices.ComTypes/CALLCONV.xml
-M      en/System.Runtime.InteropServices.ComTypes/IEnumMoniker.xml
-M      en/System.Runtime.InteropServices.ComTypes/IDLFLAG.xml
-M      en/System.Runtime.InteropServices.ComTypes/TYPELIBATTR.xml
-M      en/System.Runtime.InteropServices.ComTypes/ITypeInfo.xml
-M      en/System.Runtime.InteropServices.ComTypes/IDLDESC.xml
-M      en/System.Runtime.InteropServices.ComTypes/VARDESC+DESCUNION.xml
-M      en/System.Runtime.InteropServices.ComTypes/TYPEATTR.xml
-M      en/System.Runtime.InteropServices.ComTypes/IMoniker.xml
-M      en/index.xml
-M      en/System.Text/DecoderFallback.xml
-M      en/System.Text/Encoding.xml
-M      en/System.Text/EncoderFallbackBuffer.xml
-M      en/System.Text/UTF7Encoding.xml
-M      en/System.Text/UTF8Encoding.xml
-M      en/System.Text/UnicodeEncoding.xml
-M      en/System.Text/DecoderExceptionFallbackBuffer.xml
-M      en/System.Text/EncoderFallback.xml
-M      en/System.Text/DecoderReplacementFallbackBuffer.xml
-M      en/System.Text/ASCIIEncoding.xml
-M      en/System.Text/EncodingInfo.xml
-M      en/System.Text/DecoderFallbackException.xml
-M      en/System.Text/DecoderExceptionFallback.xml
-M      en/System.Text/DecoderReplacementFallback.xml
-M      en/System.Text/Decoder.xml
-M      en/System.Text/EncoderExceptionFallbackBuffer.xml
-M      en/System.Text/EncoderReplacementFallbackBuffer.xml
-M      en/System.Text/NormalizationForm.xml
-M      en/System.Text/UTF32Encoding.xml
-M      en/System.Text/StringBuilder.xml
-M      en/System.Text/EncoderFallbackException.xml
-M      en/System.Text/EncoderExceptionFallback.xml
-M      en/System.Text/EncoderReplacementFallback.xml
-M      en/System.Text/Encoder.xml
-M      en/System.Text/DecoderFallbackBuffer.xml
-M      en/System.Runtime.Remoting.Metadata/SoapAttribute.xml
-M      en/System.Runtime.Remoting.Metadata/SoapMethodAttribute.xml
-M      en/System.Runtime.Remoting.Metadata/SoapParameterAttribute.xml
-M      en/System.Runtime.Remoting.Metadata/SoapTypeAttribute.xml
-M      en/System.Runtime.Remoting.Metadata/XmlFieldOrderOption.xml
-M      en/System.Runtime.Remoting.Metadata/SoapFieldAttribute.xml
-M      en/System.Runtime.Remoting.Metadata/SoapOption.xml
-M      en/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.xml
-M      en/System.Security.Cryptography.X509Certificates/X509ContentType.xml
-M      en/System.Security.Cryptography.X509Certificates/X509Certificate.xml
-M      en/System.Runtime.Remoting.Proxies/ProxyAttribute.xml
-M      en/System.Runtime.Remoting.Proxies/RealProxy.xml
-?      en/System.IO.IsolatedStorage/IsolatedStorageSecurityState.xml
-?      en/System.IO.IsolatedStorage/IsolatedStorageSecurityOptions.xml
-M      en/System.IO.IsolatedStorage/IsolatedStorageScope.xml
-M      en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml
-M      en/System.IO.IsolatedStorage/IsolatedStorageException.xml
-M      en/System.IO.IsolatedStorage/IsolatedStorage.xml
-M      en/System.IO.IsolatedStorage/IsolatedStorageFile.xml
-M      en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml
-?      en/System.Runtime.CompilerServices/ConditionalWeakTable`2.xml
-?      en/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.xml
-?      en/System.Runtime.CompilerServices/TypeForwardedFromAttribute.xml
-?      en/System.Runtime.CompilerServices/ConditionalWeakTable`2+CreateValueCallback.xml
-M      en/System.Runtime.CompilerServices/DiscardableAttribute.xml
-M      en/System.Runtime.CompilerServices/IsConst.xml
-M      en/System.Runtime.CompilerServices/IndexerNameAttribute.xml
-M      en/System.Runtime.CompilerServices/RuntimeWrappedException.xml
-M      en/System.Runtime.CompilerServices/MethodImplAttribute.xml
-M      en/System.Runtime.CompilerServices/CompilationRelaxations.xml
-M      en/System.Runtime.CompilerServices/DateTimeConstantAttribute.xml
-M      en/System.Runtime.CompilerServices/IsLong.xml
-M      en/System.Runtime.CompilerServices/LoadHint.xml
-M      en/System.Runtime.CompilerServices/IsByValue.xml
-M      en/System.Runtime.CompilerServices/NativeCppClassAttribute.xml
-M      en/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml
-M      en/System.Runtime.CompilerServices/IUnknownConstantAttribute.xml
-M      en/System.Runtime.CompilerServices/TypeForwardedToAttribute.xml
-M      en/System.Runtime.CompilerServices/IsImplicitlyDereferenced.xml
-M      en/System.Runtime.CompilerServices/DefaultDependencyAttribute.xml
-M      en/System.Runtime.CompilerServices/CallConvStdcall.xml
-M      en/System.Runtime.CompilerServices/CompilerGlobalScopeAttribute.xml
-M      en/System.Runtime.CompilerServices/ScopelessEnumAttribute.xml
-M      en/System.Runtime.CompilerServices/CallConvFastcall.xml
-M      en/System.Runtime.CompilerServices/RuntimeHelpers+TryCode.xml
-M      en/System.Runtime.CompilerServices/CompilationRelaxationsAttribute.xml
-M      en/System.Runtime.CompilerServices/IsExplicitlyDereferenced.xml
-M      en/System.Runtime.CompilerServices/MethodImplOptions.xml
-M      en/System.Runtime.CompilerServices/CompilerMarshalOverride.xml
-M      en/System.Runtime.CompilerServices/IsCopyConstructed.xml
-M      en/System.Runtime.CompilerServices/RuntimeHelpers+CleanupCode.xml
-M      en/System.Runtime.CompilerServices/StringFreezingAttribute.xml
-M      en/System.Runtime.CompilerServices/CallConvThiscall.xml
-M      en/System.Runtime.CompilerServices/FixedAddressValueTypeAttribute.xml
-M      en/System.Runtime.CompilerServices/IsUdtReturn.xml
-M      en/System.Runtime.CompilerServices/RequiredAttributeAttribute.xml
-M      en/System.Runtime.CompilerServices/CallConvCdecl.xml
-M      en/System.Runtime.CompilerServices/DecimalConstantAttribute.xml
-M      en/System.Runtime.CompilerServices/IsBoxed.xml
-M      en/System.Runtime.CompilerServices/IsSignUnspecifiedByte.xml
-M      en/System.Runtime.CompilerServices/HasCopySemanticsAttribute.xml
-M      en/System.Runtime.CompilerServices/RuntimeCompatibilityAttribute.xml
-M      en/System.Runtime.CompilerServices/DependencyAttribute.xml
-M      en/System.Runtime.CompilerServices/SuppressIldasmAttribute.xml
-M      en/System.Runtime.CompilerServices/AccessedThroughPropertyAttribute.xml
-M      en/System.Runtime.CompilerServices/UnsafeValueTypeAttribute.xml
-M      en/System.Runtime.CompilerServices/IsJitIntrinsic.xml
-M      en/System.Runtime.CompilerServices/SpecialNameAttribute.xml
-M      en/System.Runtime.CompilerServices/IDispatchConstantAttribute.xml
-M      en/System.Runtime.CompilerServices/RuntimeHelpers.xml
-M      en/System.Runtime.CompilerServices/CustomConstantAttribute.xml
-M      en/System.Runtime.CompilerServices/IsPinned.xml
-M      en/System.Runtime.CompilerServices/IsVolatile.xml
-M      en/System.Runtime.CompilerServices/FixedBufferAttribute.xml
-M      en/System.Runtime.CompilerServices/CompilerGeneratedAttribute.xml
-M      en/System.Runtime.CompilerServices/MethodCodeType.xml
-?      en/System.Security.Cryptography/Aes.xml
-M      en/System.Security.Cryptography/MD5CryptoServiceProvider.xml
-M      en/System.Security.Cryptography/RIPEMD160Managed.xml
-M      en/System.Security.Cryptography/RC2.xml
-M      en/System.Security.Cryptography/TripleDESCryptoServiceProvider.xml
-M      en/System.Security.Cryptography/RSAOAEPKeyExchangeFormatter.xml
-M      en/System.Security.Cryptography/CryptographicException.xml
-M      en/System.Security.Cryptography/HMACSHA384.xml
-M      en/System.Security.Cryptography/KeySizes.xml
-M      en/System.Security.Cryptography/DSA.xml
-M      en/System.Security.Cryptography/PasswordDeriveBytes.xml
-M      en/System.Security.Cryptography/MaskGenerationMethod.xml
-M      en/System.Security.Cryptography/KeyedHashAlgorithm.xml
-M      en/System.Security.Cryptography/RSA.xml
-M      en/System.Security.Cryptography/ICryptoTransform.xml
-M      en/System.Security.Cryptography/HMACSHA1.xml
-M      en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml
-M      en/System.Security.Cryptography/Rijndael.xml
-M      en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml
-M      en/System.Security.Cryptography/HashAlgorithm.xml
-M      en/System.Security.Cryptography/TripleDES.xml
-M      en/System.Security.Cryptography/HMACSHA512.xml
-M      en/System.Security.Cryptography/SHA1.xml
-M      en/System.Security.Cryptography/RandomNumberGenerator.xml
-M      en/System.Security.Cryptography/RSAPKCS1KeyExchangeDeformatter.xml
-M      en/System.Security.Cryptography/RSAOAEPKeyExchangeDeformatter.xml
-M      en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml
-M      en/System.Security.Cryptography/FromBase64Transform.xml
-M      en/System.Security.Cryptography/SignatureDescription.xml
-M      en/System.Security.Cryptography/CryptoAPITransform.xml
-M      en/System.Security.Cryptography/RIPEMD160.xml
-M      en/System.Security.Cryptography/DESCryptoServiceProvider.xml
-M      en/System.Security.Cryptography/SHA256.xml
-M      en/System.Security.Cryptography/PKCS1MaskGenerationMethod.xml
-M      en/System.Security.Cryptography/Rfc2898DeriveBytes.xml
-M      en/System.Security.Cryptography/CspKeyContainerInfo.xml
-M      en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml
-M      en/System.Security.Cryptography/HMACMD5.xml
-M      en/System.Security.Cryptography/SHA512Managed.xml
-M      en/System.Security.Cryptography/RSACryptoServiceProvider.xml
-M      en/System.Security.Cryptography/RNGCryptoServiceProvider.xml
-M      en/System.Security.Cryptography/RC2CryptoServiceProvider.xml
-M      en/System.Security.Cryptography/SymmetricAlgorithm.xml
-M      en/System.Security.Cryptography/RSAPKCS1KeyExchangeFormatter.xml
-M      en/System.Security.Cryptography/SHA384Managed.xml
-M      en/System.Security.Cryptography/DSAParameters.xml
-M      en/System.Security.Cryptography/CryptoStream.xml
-M      en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml
-M      en/System.Security.Cryptography/HMACRIPEMD160.xml
-M      en/System.Security.Cryptography/RijndaelManagedTransform.xml
-M      en/System.Security.Cryptography/KeyNumber.xml
-M      en/System.Security.Cryptography/RijndaelManaged.xml
-M      en/System.Security.Cryptography/RSAPKCS1SignatureDeformatter.xml
-M      en/System.Security.Cryptography/HMAC.xml
-M      en/System.Security.Cryptography/RSAParameters.xml
-M      en/System.Security.Cryptography/CspParameters.xml
-M      en/System.Security.Cryptography/FromBase64TransformMode.xml
-M      en/System.Security.Cryptography/SHA1Managed.xml
-M      en/System.Security.Cryptography/SHA384.xml
-M      en/System.Security.Cryptography/PaddingMode.xml
-M      en/System.Security.Cryptography/DES.xml
-M      en/System.Security.Cryptography/CipherMode.xml
-M      en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml
-M      en/System.Security.Cryptography/ToBase64Transform.xml
-M      en/System.Security.Cryptography/AsymmetricAlgorithm.xml
-M      en/System.Security.Cryptography/MD5.xml
-M      en/System.Security.Cryptography/DeriveBytes.xml
-M      en/System.Security.Cryptography/SHA256Managed.xml
-M      en/System.Security.Cryptography/DSASignatureDeformatter.xml
-M      en/System.Security.Cryptography/RSAPKCS1SignatureFormatter.xml
-M      en/System.Security.Cryptography/CryptoStreamMode.xml
-M      en/System.Security.Cryptography/HMACSHA256.xml
-M      en/System.Security.Cryptography/ICspAsymmetricAlgorithm.xml
-M      en/System.Security.Cryptography/SHA512.xml
-M      en/System.Security.Cryptography/DSACryptoServiceProvider.xml
-M      en/System.Security.Cryptography/CryptoConfig.xml
-M      en/System.Security.Cryptography/MACTripleDES.xml
-M      en/System.Security.Cryptography/CspProviderFlags.xml
-M      en/System.Security.Cryptography/DSASignatureFormatter.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYear.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapQName.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNcName.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/ISoapXsd.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapAnyUri.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtoken.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntity.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDay.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapToken.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNegativeInteger.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapName.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonthDay.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapLanguage.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDuration.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdref.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapBase64Binary.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonNegativeInteger.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNotation.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDateTime.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapInteger.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtokens.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapTime.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYearMonth.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdrefs.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDate.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapPositiveInteger.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntities.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonth.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinary.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonPositiveInteger.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNormalizedString.xml
-M      en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapId.xml
-M      en/System.Runtime.Remoting.Lifetime/ClientSponsor.xml
-M      en/System.Runtime.Remoting.Lifetime/ILease.xml
-M      en/System.Runtime.Remoting.Lifetime/LifetimeServices.xml
-M      en/System.Runtime.Remoting.Lifetime/LeaseState.xml
-M      en/System.Runtime.Remoting.Lifetime/ISponsor.xml
-M      en/System.Security.Policy/PublisherMembershipCondition.xml
-M      en/System.Security.Policy/ApplicationTrustCollection.xml
-M      en/System.Security.Policy/Evidence.xml
-M      en/System.Security.Policy/Hash.xml
-M      en/System.Security.Policy/PolicyStatement.xml
-M      en/System.Security.Policy/UrlMembershipCondition.xml
-M      en/System.Security.Policy/ApplicationSecurityManager.xml
-M      en/System.Security.Policy/ApplicationVersionMatch.xml
-M      en/System.Security.Policy/SiteMembershipCondition.xml
-M      en/System.Security.Policy/CodeGroup.xml
-M      en/System.Security.Policy/FileCodeGroup.xml
-M      en/System.Security.Policy/ApplicationDirectory.xml
-M      en/System.Security.Policy/ZoneMembershipCondition.xml
-M      en/System.Security.Policy/UnionCodeGroup.xml
-M      en/System.Security.Policy/Url.xml
-M      en/System.Security.Policy/Site.xml
-M      en/System.Security.Policy/ApplicationTrust.xml
-M      en/System.Security.Policy/HashMembershipCondition.xml
-M      en/System.Security.Policy/CodeConnectAccess.xml
-M      en/System.Security.Policy/ApplicationSecurityInfo.xml
-M      en/System.Security.Policy/ApplicationTrustEnumerator.xml
-M      en/System.Security.Policy/PolicyStatementAttribute.xml
-M      en/System.Security.Policy/IApplicationTrustManager.xml
-M      en/System.Security.Policy/IMembershipCondition.xml
-M      en/System.Security.Policy/FirstMatchCodeGroup.xml
-M      en/System.Security.Policy/StrongName.xml
-M      en/System.Security.Policy/PolicyException.xml
-M      en/System.Security.Policy/TrustManagerUIContext.xml
-M      en/System.Security.Policy/TrustManagerContext.xml
-M      en/System.Security.Policy/PolicyLevel.xml
-M      en/System.Security.Policy/GacInstalled.xml
-M      en/System.Security.Policy/AllMembershipCondition.xml
-M      en/System.Security.Policy/Publisher.xml
-M      en/System.Security.Policy/NetCodeGroup.xml
-M      en/System.Security.Policy/StrongNameMembershipCondition.xml
-M      en/System.Security.Policy/IIdentityPermissionFactory.xml
-M      en/System.Security.Policy/PermissionRequestEvidence.xml
-M      en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml
-M      en/System.Security.Policy/Zone.xml
-M      en/System.Security.Policy/GacMembershipCondition.xml
-M      en/System.Runtime.Remoting/ObjectHandle.xml
-M      en/System.Runtime.Remoting/ServerException.xml
-M      en/System.Runtime.Remoting/InternalRemotingServices.xml
-M      en/System.Runtime.Remoting/IEnvoyInfo.xml
-M      en/System.Runtime.Remoting/WellKnownServiceTypeEntry.xml
-M      en/System.Runtime.Remoting/ActivatedClientTypeEntry.xml
-M      en/System.Runtime.Remoting/RemotingServices.xml
-M      en/System.Runtime.Remoting/IObjectHandle.xml
-M      en/System.Runtime.Remoting/IChannelInfo.xml
-M      en/System.Runtime.Remoting/CustomErrorsModes.xml
-M      en/System.Runtime.Remoting/RemotingException.xml
-M      en/System.Runtime.Remoting/TypeEntry.xml
-M      en/System.Runtime.Remoting/WellKnownClientTypeEntry.xml
-M      en/System.Runtime.Remoting/SoapServices.xml
-M      en/System.Runtime.Remoting/ObjRef.xml
-M      en/System.Runtime.Remoting/ActivatedServiceTypeEntry.xml
-M      en/System.Runtime.Remoting/RemotingTimeoutException.xml
-M      en/System.Runtime.Remoting/IRemotingTypeInfo.xml
-M      en/System.Runtime.Remoting/RemotingConfiguration.xml
-M      en/System.Runtime.Remoting/WellKnownObjectMode.xml
-?      en/System.IO/UnmanagedMemoryAccessor.xml
-M      en/System.IO/DirectoryInfo.xml
-M      en/System.IO/MemoryStream.xml
-M      en/System.IO/FileMode.xml
-M      en/System.IO/DriveInfo.xml
-M      en/System.IO/IOException.xml
-M      en/System.IO/FileAttributes.xml
-M      en/System.IO/StringReader.xml
-M      en/System.IO/Stream.xml
-M      en/System.IO/FileStream.xml
-M      en/System.IO/FileInfo.xml
-M      en/System.IO/SearchOption.xml
-M      en/System.IO/DirectoryNotFoundException.xml
-M      en/System.IO/FileAccess.xml
-M      en/System.IO/FileShare.xml
-M      en/System.IO/StringWriter.xml
-M      en/System.IO/Directory.xml
-M      en/System.IO/BinaryReader.xml
-M      en/System.IO/TextReader.xml
-M      en/System.IO/StreamReader.xml
-M      en/System.IO/File.xml
-M      en/System.IO/BinaryWriter.xml
-M      en/System.IO/TextWriter.xml
-M      en/System.IO/EndOfStreamException.xml
-M      en/System.IO/StreamWriter.xml
-M      en/System.IO/FileOptions.xml
-M      en/System.IO/Path.xml
-M      en/System.IO/BufferedStream.xml
-M      en/System.IO/FileLoadException.xml
-M      en/System.IO/SeekOrigin.xml
-M      en/System.IO/FileSystemInfo.xml
-M      en/System.IO/UnmanagedMemoryStream.xml
-M      en/System.IO/DriveNotFoundException.xml
-M      en/System.IO/FileNotFoundException.xml
-M      en/System.IO/DriveType.xml
-M      en/System.IO/PathTooLongException.xml
-?      en/System.Runtime/AssemblyTargetedPatchBandAttribute.xml
-?      en/System.Runtime/TargetedPatchingOptOutAttribute.xml
-M      en/System.Runtime/GCSettings.xml
-M      en/System.Runtime/GCLatencyMode.xml
-M      en/System.Runtime/MemoryFailPoint.xml
-?      en/Microsoft.Win32/RegistryView.xml
-?      en/Microsoft.Win32/RegistryOptions.xml
-M      en/Microsoft.Win32/RegistryKey.xml
-M      en/Microsoft.Win32/RegistryValueOptions.xml
-M      en/Microsoft.Win32/RegistryHive.xml
-M      en/Microsoft.Win32/Registry.xml
-M      en/Microsoft.Win32/RegistryKeyPermissionCheck.xml
-M      en/Microsoft.Win32/RegistryValueKind.xml
-M      en/System.Runtime.Serialization.Formatters/ISoapMessage.xml
-M      en/System.Runtime.Serialization.Formatters/ServerFault.xml
-M      en/System.Runtime.Serialization.Formatters/InternalST.xml
-M      en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml
-M      en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml
-M      en/System.Runtime.Serialization.Formatters/SoapMessage.xml
-M      en/System.Runtime.Serialization.Formatters/IFieldInfo.xml
-M      en/System.Runtime.Serialization.Formatters/InternalRM.xml
-M      en/System.Runtime.Serialization.Formatters/SoapFault.xml
-M      en/System.Runtime.Serialization.Formatters/TypeFilterLevel.xml
-M      en/System.Runtime.Remoting.Services/EnterpriseServicesHelper.xml
-M      en/System.Runtime.Remoting.Services/TrackingServices.xml
-M      en/System.Runtime.Remoting.Services/ITrackingHandler.xml
-M      en/System.Reflection/Pointer.xml
-M      en/System.Reflection/MemberInfo.xml
-M      en/System.Reflection/TypeFilter.xml
-M      en/System.Reflection/EventAttributes.xml
-M      en/System.Reflection/IReflect.xml
-M      en/System.Reflection/FieldInfo.xml
-M      en/System.Reflection/CallingConventions.xml
-M      en/System.Reflection/ObfuscationAttribute.xml
-M      en/System.Reflection/AssemblyTitleAttribute.xml
-M      en/System.Reflection/MethodImplAttributes.xml
-M      en/System.Reflection/MethodBase.xml
-M      en/System.Reflection/AssemblyKeyFileAttribute.xml
-M      en/System.Reflection/MemberFilter.xml
-M      en/System.Reflection/AssemblyName.xml
-M      en/System.Reflection/AssemblyFlagsAttribute.xml
-M      en/System.Reflection/GenericParameterAttributes.xml
-M      en/System.Reflection/Module.xml
-M      en/System.Reflection/ParameterAttributes.xml
-M      en/System.Reflection/AssemblyAlgorithmIdAttribute.xml
-M      en/System.Reflection/BindingFlags.xml
-M      en/System.Reflection/TypeAttributes.xml
-M      en/System.Reflection/PropertyAttributes.xml
-M      en/System.Reflection/ParameterInfo.xml
-M      en/System.Reflection/AssemblyCopyrightAttribute.xml
-M      en/System.Reflection/ResourceAttributes.xml
-M      en/System.Reflection/TargetInvocationException.xml
-M      en/System.Reflection/DefaultMemberAttribute.xml
-M      en/System.Reflection/PropertyInfo.xml
-M      en/System.Reflection/ConstructorInfo.xml
-M      en/System.Reflection/PortableExecutableKinds.xml
-M      en/System.Reflection/AssemblyDelaySignAttribute.xml
-M      en/System.Reflection/AssemblyCultureAttribute.xml
-M      en/System.Reflection/Missing.xml
-M      en/System.Reflection/ReflectionTypeLoadException.xml
-M      en/System.Reflection/LocalVariableInfo.xml
-M      en/System.Reflection/InterfaceMapping.xml
-M      en/System.Reflection/ResourceLocation.xml
-M      en/System.Reflection/AssemblyDefaultAliasAttribute.xml
-M      en/System.Reflection/ModuleResolveEventHandler.xml
-M      en/System.Reflection/CustomAttributeFormatException.xml
-M      en/System.Reflection/AmbiguousMatchException.xml
-M      en/System.Reflection/CustomAttributeData.xml
-M      en/System.Reflection/FieldAttributes.xml
-M      en/System.Reflection/AssemblyCompanyAttribute.xml
-M      en/System.Reflection/AssemblyInformationalVersionAttribute.xml
-M      en/System.Reflection/EventInfo.xml
-M      en/System.Reflection/AssemblyNameFlags.xml
-M      en/System.Reflection/MethodBody.xml
-M      en/System.Reflection/InvalidFilterCriteriaException.xml
-M      en/System.Reflection/AssemblyTrademarkAttribute.xml
-M      en/System.Reflection/ObfuscateAssemblyAttribute.xml
-M      en/System.Reflection/StrongNameKeyPair.xml
-M      en/System.Reflection/Binder.xml
-M      en/System.Reflection/AssemblyProductAttribute.xml
-M      en/System.Reflection/CustomAttributeTypedArgument.xml
-M      en/System.Reflection/TypeDelegator.xml
-M      en/System.Reflection/ExceptionHandlingClauseOptions.xml
-M      en/System.Reflection/AssemblyKeyNameAttribute.xml
-M      en/System.Reflection/TargetParameterCountException.xml
-M      en/System.Reflection/ProcessorArchitecture.xml
-M      en/System.Reflection/ICustomAttributeProvider.xml
-M      en/System.Reflection/AssemblyNameProxy.xml
-M      en/System.Reflection/MethodAttributes.xml
-M      en/System.Reflection/ManifestResourceInfo.xml
-M      en/System.Reflection/AssemblyConfigurationAttribute.xml
-M      en/System.Reflection/MethodInfo.xml
-M      en/System.Reflection/MemberTypes.xml
-M      en/System.Reflection/ParameterModifier.xml
-M      en/System.Reflection/ExceptionHandlingClause.xml
-M      en/System.Reflection/TargetException.xml
-M      en/System.Reflection/CustomAttributeNamedArgument.xml
-M      en/System.Reflection/ImageFileMachine.xml
-M      en/System.Reflection/AssemblyDescriptionAttribute.xml
-M      en/System.Reflection/AssemblyFileVersionAttribute.xml
-M      en/System.Reflection/AssemblyVersionAttribute.xml
-M      en/System.Reflection/Assembly.xml
index 7a5f9887c6334fff01b0f7f9835659b44fac9be3..efac37b709affdcf88a28ff4184b3d07043f777d 100644 (file)
@@ -40,11 +40,26 @@ namespace Mono {
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private static extern void mono_runtime_install_handlers ();
 
-               static internal void InstallSignalHandlers ()
+#if MOBILE
+               public
+#else
+               internal
+#endif
+               static void InstallSignalHandlers ()
                {
                        mono_runtime_install_handlers ();
                }
 
+#if MOBILE
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               static extern void mono_runtime_cleanup_handlers ();
+
+               public static void RemoveSignalHandlers ()
+               {
+                       mono_runtime_cleanup_handlers ();
+               }
+#endif
+
                // Should not be removed intended for external use
                // Safe to be called using reflection
                // Format is undefined only for use as a string for reporting
index 78cd58f81a89c863c60a9a9e4088d312b35c0828..40707aa77901e4ef83744e4a1f0a980daf7ee26f 100644 (file)
@@ -345,15 +345,13 @@ namespace System
 
                unsafe String ReplaceInternal (char oldChar, char newChar)
                {
-#if !BOOTSTRAP_BASIC                   
                        if (this.m_stringLength == 0 || oldChar == newChar)
                                return this;
-#endif
+
                        int start_pos = IndexOfUnchecked (oldChar, 0, this.m_stringLength);
-#if !BOOTSTRAP_BASIC
                        if (start_pos == -1)
                                return this;
-#endif
+
                        if (start_pos < 4)
                                start_pos = 0;
 
@@ -391,11 +389,8 @@ namespace System
                                throw new ArgumentException ("oldValue is the empty string.");
 
                        if (this.Length == 0)
-#if BOOTSTRAP_BASIC
-                               throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
                                return this;
-#endif
+
                        if (newValue == null)
                                newValue = Empty;
 
@@ -405,11 +400,7 @@ namespace System
                private unsafe String ReplaceUnchecked (String oldValue, String newValue)
                {
                        if (oldValue.m_stringLength > m_stringLength)
-#if BOOTSTRAP_BASIC
-                               throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
                                return this;
-#endif
 
                        if (oldValue.m_stringLength == 1 && newValue.m_stringLength == 1) {
                                return Replace (oldValue[0], newValue[0]);
@@ -434,11 +425,8 @@ namespace System
                                        i = found + oldValue.m_stringLength;
                                }
                                if (count == 0)
-#if BOOTSTRAP_BASIC
-                               throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
-                               return this;
-#endif
+                                       return this;
+
                                int nlen = 0;
                                checked {
                                        try {
@@ -488,11 +476,8 @@ namespace System
                        if (totalWidth < 0)
                                throw new ArgumentOutOfRangeException ("totalWidth", "Non-negative number required");
                        if (totalWidth <= m_stringLength)
-#if BOOTSTRAP_BASIC
-                               throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else                  
                                return this;
-#endif
+
                        string result = FastAllocateString (totalWidth);
 
                        fixed (char *dest = result, src = &m_firstChar) {
@@ -518,11 +503,7 @@ namespace System
 
                internal bool StartsWithOrdinalUnchecked (String value)
                {
-#if BOOTSTRAP_BASIC
-                       throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
                        return m_stringLength >= value.m_stringLength && CompareOrdinalUnchecked (this, 0, value.m_stringLength, value, 0, value.m_stringLength) == 0;
-#endif
                }
 
                internal unsafe bool IsAscii ()
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceException.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceException.cs
deleted file mode 100644 (file)
index 3602e29..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// EventSourceException.cs
-//
-// Authors:
-//     Alexander Köplinger <alexander.koeplinger@xamarin.com>
-//
-// Copyright (C) 2016 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.
-//
-
-using System;
-
-namespace System.Diagnostics.Tracing
-{
-       public class EventSourceException : Exception
-       {
-               [MonoTODO]
-               public EventSourceException ()
-               {
-               }
-
-               [MonoTODO]
-               public EventSourceException (string message)
-               {
-               }
-
-               [MonoTODO]
-               public EventSourceException (string message, Exception innerException)
-               {
-               }
-       }
-}
index de55602cdbe4437a6def908340a01e5156e25b94..d3eebc441064065b3045fd0dfc83525f28864ae3 100644 (file)
@@ -38,10 +38,7 @@ using System.Diagnostics;
 using System.Security;
 using System.Text;
 using System.Runtime.InteropServices;
-
-#if !MOBILE
 using System.Security.AccessControl;
-#endif
 
 namespace System.IO
 {
@@ -147,7 +144,6 @@ namespace System.IO
                                FileShare.None, bufferSize, options);
                }
 
-#if !MOBILE
                [MonoLimitation ("FileOptions and FileSecurity are ignored")]
                public static FileStream Create (string path, int bufferSize,
                                                 FileOptions options,
@@ -156,7 +152,6 @@ namespace System.IO
                        return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
                                FileShare.None, bufferSize, options);
                }
-#endif
 
                public static StreamWriter CreateText (string path)
                {
@@ -201,7 +196,6 @@ namespace System.IO
                        return MonoIO.ExistsFile (path, out error);
                }
 
-#if !MOBILE
                public static FileSecurity GetAccessControl (string path)
                {
                        // AccessControlSections.Audit requires special permissions.
@@ -215,7 +209,6 @@ namespace System.IO
                {
                        return new FileSecurity (path, includeSections);
                }
-#endif
 
                public static FileAttributes GetAttributes (string path)
                {
@@ -434,7 +427,6 @@ namespace System.IO
                        }
                }
 
-#if !MOBILE
                public static void SetAccessControl (string path,
                                                     FileSecurity fileSecurity)
                {
@@ -443,7 +435,6 @@ namespace System.IO
 
                        fileSecurity.PersistModifications (path);
                }
-#endif
 
                public static void SetAttributes (string path,
                                                  FileAttributes fileAttributes)
index b2a15cd2b600fce61cdf1282ee7ce76695851966..db13468d36fcfaa9a4f0d82164ae8a33ccfeb2cf 100644 (file)
@@ -37,17 +37,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Remoting.Messaging;
 using System.Security;
+using System.Security.AccessControl;
 using System.Security.Permissions;
 using System.Threading;
-using Microsoft.Win32.SafeHandles;
-
-#if MOBILE
-using System.IO.IsolatedStorage;
-#else
-using System.Security.AccessControl;
-#endif
-
 using System.Threading.Tasks;
+using Microsoft.Win32.SafeHandles;
 
 namespace System.IO
 {
@@ -129,7 +123,6 @@ namespace System.IO
                        Init (handle, access, false, bufferSize, isAsync, false);
                }
 
-#if !MOBILE
                [MonoLimitation ("This ignores the rights parameter")]
                public FileStream (string path, FileMode mode,
                                   FileSystemRights rights, FileShare share,
@@ -146,7 +139,6 @@ namespace System.IO
                        : this (path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), share, bufferSize, false, options)
                {
                }
-#endif
 
                internal FileStream (string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, string msgPath, bool bFromProxy, bool useLongPath = false, bool checkHost = false)
                        : this (path, mode, access, share, bufferSize, false, options)
@@ -942,7 +934,6 @@ namespace System.IO
                                throw exc;
                }
 
-#if !MOBILE
                public FileSecurity GetAccessControl ()
                {
                        if (safeHandle.IsClosed)
@@ -964,7 +955,6 @@ namespace System.IO
                                
                        fileSecurity.PersistModifications (SafeFileHandle);
                }
-#endif
 
                public override Task FlushAsync (CancellationToken cancellationToken)
                {
index d6c39114f16ef3da670dd957008a1c592b08af79..8d485153e38157f892cea66037eb53e78e76057a 100644 (file)
@@ -348,9 +348,6 @@ namespace System.Reflection.Emit {
                        return null;
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private static extern Type create_modified_type (TypeBuilder tb, string modifiers);
-
                private TypeBuilder GetMaybeNested (TypeBuilder t, IEnumerable<TypeName> nested) {
                        TypeBuilder result = t;
 
@@ -392,8 +389,27 @@ namespace System.Reflection.Emit {
                        if ((result == null) && throwOnError)
                                throw new TypeLoadException (className);
                        if (result != null && (ts.HasModifiers || ts.IsByRef)) {
-                               string modifiers = ts.ModifierString ();
-                               Type mt = create_modified_type (result, modifiers);
+                               Type mt = result;
+                               if (result is TypeBuilder) {
+                                       var tb = result as TypeBuilder;
+                                       if (tb.is_created)
+                                               mt = tb.CreateType ();
+                               }
+                               foreach (var mod in ts.Modifiers) {
+                                       if (mod is PointerSpec)
+                                               mt = mt.MakePointerType ();
+                                       else if (mod is ArraySpec) {
+                                               var spec = mod as ArraySpec;
+                                               if (spec.IsBound)
+                                                       return null;
+                                               if (spec.Rank == 1)
+                                                       mt = mt.MakeArrayType ();
+                                               else
+                                                       mt = mt.MakeArrayType (spec.Rank);
+                                       }
+                               }
+                               if (ts.IsByRef)
+                                       mt = mt.MakeByRefType ();
                                result = mt as TypeBuilder;
                                if (result == null)
                                        return mt;
index bce2832992eea36e25b13b86a689a62fa512fdb5..4f8948cc265081e49b9f9717e04267ab0aabe4db 100644 (file)
@@ -53,11 +53,12 @@ namespace System.Reflection {
        [ClassInterface(ClassInterfaceType.None)]
        [StructLayout (LayoutKind.Sequential)]
 #if MOBILE
-       public partial class Assembly : ICustomAttributeProvider {
+       public partial class Assembly : ICustomAttributeProvider, ISerializable
 #else
-       public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
+       public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable
 #endif
-               internal class ResolveEventHolder {
+       {
+               internal class ResolveEventHolder {     
 #pragma warning disable 67
                        public event ModuleResolveEventHandler ModuleResolve;
 #pragma warning restore
@@ -119,7 +120,7 @@ namespace System.Reflection {
                // We can't store the event directly in this class, since the
                // compiler would silently insert the fields before _mono_assembly
                //
-               public event ModuleResolveEventHandler ModuleResolve {
+               public virtual event ModuleResolveEventHandler ModuleResolve {
                        [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
                        add {
                                resolve_event_holder.ModuleResolve += value;
@@ -896,13 +897,12 @@ namespace System.Reflection {
                public virtual PermissionSet PermissionSet {
                        get { return this.GrantedPermissionSet; }
                }
-               
+#endif
+
                public virtual SecurityRuleSet SecurityRuleSet {
                        get { throw CreateNIE (); }
                }
 
-#endif
-
                static Exception CreateNIE ()
                {
                        return new NotImplementedException ("Derived classes must implement it");
diff --git a/mcs/class/corlib/System.Reflection/TargetException.cs b/mcs/class/corlib/System.Reflection/TargetException.cs
deleted file mode 100644 (file)
index 5c5c69e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Reflection.TargetException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public class TargetException : Exception {
-#else
-       public class TargetException : ApplicationException {
-#endif
-               public TargetException ()
-                       : base (Locale.GetText ("Unable to invoke an invalid target."))
-               {
-               }
-
-               public TargetException (string message)
-                       : base (message)
-               {
-               }
-
-               public TargetException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }
-
-               protected TargetException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs b/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
deleted file mode 100644 (file)
index 5f56432..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Reflection.TargetInvocationException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak  (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public sealed class TargetInvocationException : Exception {
-#else
-       public sealed class TargetInvocationException : ApplicationException {
-#endif
-               public TargetInvocationException (Exception inner)
-                       : base ("Exception has been thrown by the target of an invocation.", inner)
-               {                       
-               }
-
-               public TargetInvocationException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }               
-
-               internal TargetInvocationException (SerializationInfo info, StreamingContext sc)
-                       : base (info, sc)
-               {
-               }
-       }       
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs b/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
deleted file mode 100644 (file)
index 8b6c2b2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Reflection.TargetParameterCountException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public sealed class TargetParameterCountException : Exception {
-#else
-       public sealed class TargetParameterCountException : ApplicationException {
-#endif
-               public TargetParameterCountException ()
-                       : base (Locale.GetText ("Number of parameter does not match expected count."))
-               {
-               }
-
-               public TargetParameterCountException (string message)
-                       : base (message)
-               {
-               }
-
-               public TargetParameterCountException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }
-
-               internal TargetParameterCountException (SerializationInfo info,
-                                                      StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
index 2bb0fd9f6c344df832f76bb55180ca188e775921..7c9f393da25234ef2bc178b23a75810937a30436 100644 (file)
@@ -35,6 +35,7 @@ namespace System.Runtime
                Batch = 0,
                Interactive = 1,
                LowLatency = 2,
-               SustainedLowLatency = 3
+               SustainedLowLatency = 3,
+               NoGCRegion = 4
        }
 }
index 8cfd398094e6fea6a08e2edd79805da54b96a29b..ac20b894ef3ea3928492ef0c4923b6ea1898c7b2 100644 (file)
@@ -127,6 +127,11 @@ namespace System.Security.AccessControl
                {
                        SetAuditRule((AuditRule)rule);
                }
+
+               internal void Persist (SafeHandle handle)
+               {
+                       PersistModifications (handle);
+               }
        }
 }
 
index ab14ac5a5eb4cd9cb0e1230e8feecc7f48f159f8..db43c8b549001e029973a5926fd63929792a1cd4 100644 (file)
@@ -135,12 +135,7 @@ namespace System.Security.AccessControl
                {
                        Persist (name, includeSections, null);
                }
-
-               internal void Persist (SafeHandle handle)
-               {
-                       PersistModifications (handle);
-               }
-               
+       
                internal void PersistModifications (SafeHandle handle)
                {
                        WriteLock();
index 93c4c2d451a93713bdd13c0579d95aaa8fc6a277..4bed60fc3b93acbda77c62ddc51f284fc284254c 100644 (file)
@@ -166,7 +166,7 @@ namespace System.Security.AccessControl
                        SetAuditRule((AuditRule)rule);
                }
                
-               protected new void Persist (SafeHandle handle)
+               protected void Persist (SafeHandle handle)
                {
                        WriteLock ();
                        try {
index b8c91df3940489eac573c9c2801590be6298de8d..2e19104a39d81b5d9b92fdc6b2eda620468c3fad 100644 (file)
@@ -460,6 +460,12 @@ namespace System.Threading {
                {
                        throw new PlatformNotSupportedException ("Thread.ResetAbort is not supported on the current platform.");
                }
+
+               internal object AbortReason {
+                       get {
+                               throw new PlatformNotSupportedException ("Thread.ResetAbort is not supported on the current platform.");
+                       }
+               }
 #endif // MONO_FEATURE_THREAD_ABORT
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
@@ -704,5 +710,10 @@ namespace System.Threading {
                        throw new PlatformNotSupportedException ("Thread.Resume is not supported on the current platform.");
                }
 #endif
+
+               public void DisableComObjectEagerCleanup ()
+               {
+                       throw new PlatformNotSupportedException ();
+               }
        }
 }
index 7b10091733fc45bc3ca209b9176aa842b5569925..5e854cbe3e439f01312ecdf1ffe3b075c188a676 100644 (file)
@@ -57,7 +57,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 156;
+               private const int mono_corlib_version = 157;
 #pragma warning restore 169
 
                [ComVisible (true)]
@@ -322,7 +322,7 @@ namespace System {
                                return trace.ToString ();
                        }
                }
-#if !MOBILE
+
                /// <summary>
                /// Get a fully qualified path to the system directory
                /// </summary>
@@ -331,7 +331,7 @@ namespace System {
                                return GetFolderPath (SpecialFolder.System);
                        }
                }
-#endif
+
                /// <summary>
                /// Get the number of milliseconds that have elapsed since the system was booted
                /// </summary>
index 3cf08ae352089a434b6c8ac006bf6ab5e9c6e1a3..f233bec088e123de8984765477eac5827e41380f 100644 (file)
@@ -70,6 +70,18 @@ namespace System {
                {
                        return Append (new Text.StringBuilder ()).ToString ();
                }
+
+               public int Rank {
+                       get {
+                               return dimensions;
+                       }
+               }
+
+               public bool IsBound {
+                       get {
+                               return bound;
+                       }
+               }
        }
 
        internal class PointerSpec : ModifierSpec
index 7f381d63c86c36a38acf4145d9ea0d0956d1f2fd..88ae954687a88ce11d5f10cb3545a875e77c0d35 100644 (file)
@@ -794,5 +794,18 @@ namespace MonoTests.System.Reflection.Emit
                        // ArgumentNullException should not occur.
                        module.GetConstructorToken (method, null);
                }
+
+               [Test]
+               public void GetType ()
+               {
+                       AssemblyBuilder ab = genAssembly ();
+                       ModuleBuilder module = ab.DefineDynamicModule ("foo.dll", "foo.dll", true);
+                       TypeBuilder tb = module.DefineType ("t1", TypeAttributes.Public);
+
+                       Assert.AreEqual ("t1[]", module.GetType ("t1[]").FullName);
+                       Assert.AreEqual ("t1*", module.GetType ("t1*").FullName);
+                       Assert.AreEqual ("t1&", module.GetType ("t1&").FullName);
+                       Assert.AreEqual ("t1[]&", module.GetType ("t1[]&").FullName);
+               }
        }
 }
index d3115c76913f1792f567eb5069b74d9e4fa77897..43f32cfa5959467d35da5011b26986550ffe0368 100644 (file)
@@ -9094,6 +9094,8 @@ namespace MonoTests.System.Reflection.Emit
 
 
                [Test]
+               // Casts don't work with unfinished types
+               [Category ("NotWorking")]
                [Category ("NotDotNet")]
                public void IsAssignableFrom_NotCreated_Array ()
                {
index d609c188831a013943cb6c55945524a421bc1a12..dd66b8c7a2c2868e3b8b9441626c7e7c397f0f85 100644 (file)
@@ -903,7 +903,13 @@ namespace MonoTests.System
                        Assert.AreEqual (1, res.Length, "#1");
                }
 
-               abstract class Abs
+               abstract class Root
+               {
+                       [MyAttribute]
+                       public abstract void Foo ();
+               }
+
+               abstract class Abs : Root
                {
                        public abstract string Name { get; set; }
                }
@@ -915,6 +921,8 @@ namespace MonoTests.System
                                get { return ""; }
                                set {}
                        }
+
+                       public override void Foo () { }
                }
                
                class Sub: Base
@@ -1032,6 +1040,27 @@ namespace MonoTests.System
                        a.GetHashCode ();
                }
 
+
+               [Test]
+               public void DerivedClassOverrideHasInhertedAttributeFromAbstractRoot ()
+               {
+                       // regression test for #44010
+                       // we have
+                       // abstract class Root {
+                       //   [MyAttribute]
+                       //   public abstract void Foo ();
+                       // }
+                       // abstract class Abs : Root { }
+                       // class Base : Abs {
+                       //   public override void  Foo () { }
+                       // }
+                       // note that Abs does not itself override Foo.
+                       var bt = typeof(Base);
+                       var m = bt.GetMethod ("Foo");
+                       var attribute = Attribute.GetCustomAttribute (m, typeof (MyAttribute), true);
+                       Assert.IsNotNull (attribute);
+               }
+
                class ArrayAttribute : Attribute
                {
 #pragma warning disable 414
index 3808a5985572150b5f06eabd3f67149a42bc9401..3716291a2686d256f3466d4aa50d8b7ff0025a72 100644 (file)
@@ -177,7 +177,6 @@ System.Diagnostics.Tracing/EventFieldFormat.cs
 System.Diagnostics.Tracing/EventFieldTags.cs
 System.Diagnostics.Tracing/EventIgnoreAttribute.cs
 System.Diagnostics.Tracing/EventManifestOptions.cs
-System.Diagnostics.Tracing/EventSourceException.cs
 System.Diagnostics.SymbolStore/ISymbolBinder.cs
 System.Diagnostics.SymbolStore/ISymbolBinder1.cs
 System.Diagnostics.SymbolStore/ISymbolDocument.cs
@@ -259,9 +258,6 @@ System.Reflection/PortableExecutableKinds.cs
 System.Reflection/PropertyInfo.cs
 System.Reflection/ReflectionTypeLoadException.cs
 System.Reflection/StrongNameKeyPair.cs
-System.Reflection/TargetException.cs
-System.Reflection/TargetInvocationException.cs
-System.Reflection/TargetParameterCountException.cs
 System.Reflection.Emit/AssemblyBuilder.cs
 System.Reflection.Emit/AssemblyBuilderAccess.cs
 System.Reflection.Emit/ConstructorBuilder.cs
@@ -1138,6 +1134,7 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs
 
 ../referencesource/mscorlib/system/diagnostics/eventing/eventactivityoptions.cs
+../referencesource/mscorlib/system/diagnostics/eventing/eventsourceexception.cs
 ../referencesource/mscorlib/system/diagnostics/eventing/winmeta.cs
 
 ../referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventSourceOptions.cs
@@ -1255,6 +1252,9 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/system/reflection/reflectioncontext.cs
 ../referencesource/mscorlib/system/reflection/resourceattributes.cs
 ../referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs
+../referencesource/mscorlib/system/reflection/targetexception.cs
+../referencesource/mscorlib/system/reflection/targetinvocationexception.cs
+../referencesource/mscorlib/system/reflection/targetparametercountexception.cs
 ../referencesource/mscorlib/system/reflection/typeattributes.cs
 ../referencesource/mscorlib/system/reflection/typedelegator.cs
 ../referencesource/mscorlib/system/reflection/typefilter.cs
@@ -1375,6 +1375,7 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/FormattableStringFactory.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/hascopysemanticsattribute.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/IAsyncStateMachine.cs
+../referencesource/mscorlib/system/runtime/compilerservices/idispatchconstantattribute.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/indexernameattribute.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/INotifyCompletion.cs
 ../referencesource/mscorlib/system/runtime/compilerservices/internalsvisibletoattribute.cs
diff --git a/mcs/class/corlib/net_4_x_corlib.dll.sources b/mcs/class/corlib/net_4_x_corlib.dll.sources
deleted file mode 100644 (file)
index 2ea5c40..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include corlib.dll.sources
-../referencesource/mscorlib/system/runtime/compilerservices/idispatchconstantattribute.cs
index 329928fd80ca3f0ddcb6cb1fc9d799903b80b468..b87eecde4e0d3524529469383fca3cdb6e696a69 100644 (file)
@@ -48,6 +48,10 @@ namespace System.Runtime.CompilerServices {
         public static DebugInfoGenerator CreatePdbGenerator() {
             return new SymbolDocumentGenerator();
         }
+#else
+        public static DebugInfoGenerator CreatePdbGenerator() {
+            throw new PlatformNotSupportedException();
+        }
 #endif
         /// <summary>
         /// Marks a sequence point.
index c2d07020d5896115448953dc25dcf7c133519f18..8dec8d4d72c2ee37bd13c0bf764bacb4f8de8118 100644 (file)
@@ -189,7 +189,9 @@ namespace System.Linq.Parallel
 
             private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> m_leftSource; // Left data source.
             private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TRightKey> m_rightSource; // Right data source.
+#if !MONO
             private readonly int m_partitionIndex; // The current partition.
+#endif
             private Set<TInputOutput> m_hashLookup; // The hash lookup, used to produce the union.
             private CancellationToken m_cancellationToken;
             private Shared<int> m_outputLoopCount;
@@ -210,7 +212,9 @@ namespace System.Linq.Parallel
 
                 m_leftSource = leftSource;
                 m_rightSource = rightSource;
+#if !MONO
                 m_partitionIndex = partitionIndex;
+#endif
                 m_comparer = comparer;
                 m_cancellationToken = cancellationToken;
             }
index 33baf3f8056e37c2b090c14ede08fa5fb4759382..08ae2840d333c766b2f91da8b331feeb1323f8f7 100644 (file)
@@ -23,8 +23,10 @@ namespace System.Linq.Parallel
     /// <typeparam name="TSource"></typeparam>
     internal sealed class OrderingQueryOperator<TSource> : QueryOperator<TSource>
     {
+#if !MONO
         // Turns on order (AsOrdered) or turns off order (AsUnordered)
         private bool m_orderOn;
+#endif
         private QueryOperator<TSource> m_child;
         private OrdinalIndexState m_ordinalIndexState;
 
@@ -33,7 +35,9 @@ namespace System.Linq.Parallel
         {
             m_child = child;
             m_ordinalIndexState = m_child.OrdinalIndexState;
+#if !MONO
             m_orderOn = orderOn;
+#endif
         }
 
         internal override QueryResults<TSource> Open(QuerySettings settings, bool preferStriping)
index d55436affb55dc0108c0df5b39eb618478784ce4..6f8c4a521f50cbfef3b9221022c8b7808fc710cd 100644 (file)
@@ -233,7 +233,9 @@ namespace System.Linq.Parallel
 
         class ConcatQueryOperatorResults : BinaryQueryOperatorResults
         {
+#if !MONO
             ConcatQueryOperator<TSource> m_concatOp; // Operator that generated the results
+#endif
             int m_leftChildCount; // The number of elements in the left child result set
             int m_rightChildCount; // The number of elements in the right child result set
 
@@ -260,7 +262,9 @@ namespace System.Linq.Parallel
                 bool preferStriping)
                 : base(leftChildQueryResults, rightChildQueryResults, concatOp, settings, preferStriping)
             {
+#if !MONO
                 m_concatOp = concatOp;
+#endif
                 Contract.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible);
 
                 m_leftChildCount = leftChildQueryResults.ElementsCount;
index b73b8bd0829bd908ac8dfd0b5f6d3d59345d1804..02d220bce7815a333d8856b8580432f6272762cd 100644 (file)
@@ -150,7 +150,9 @@ namespace System.Linq.Parallel
         protected QueryResults<TInputOutput> m_childQueryResults; // Results of the child query
         private SortQueryOperator<TInputOutput, TSortKey> m_op; // Operator that generated these results
         private QuerySettings m_settings; // Settings collected from the query
+#if !MONO
         private bool m_preferStriping; // If the results are indexible, should we use striping when partitioning them
+#endif
 
         internal SortQueryOperatorResults(
             QueryResults<TInputOutput> childQueryResults, SortQueryOperator<TInputOutput, TSortKey> op,
@@ -159,7 +161,9 @@ namespace System.Linq.Parallel
             m_childQueryResults = childQueryResults;
             m_op = op;
             m_settings = settings;
+#if !MONO
             m_preferStriping = preferStriping;
+#endif
         }
 
         internal override bool IsIndexible
index f1e99baedb4ce522c751ad8098306333091d47c1..598d1e13aa3edbf10c8865de6a9a52dc678f1c76 100644 (file)
@@ -25,7 +25,9 @@ namespace System.Linq.Parallel
     class OrderPreservingPipeliningSpoolingTask<TOutput, TKey> : SpoolingTaskBase
     {
         private readonly QueryTaskGroupState m_taskGroupState; // State shared among tasks.
+#if !MONO
         private readonly TaskScheduler m_taskScheduler; // The task manager to execute the query.
+#endif
         private readonly QueryOperatorEnumerator<TOutput, TKey> m_partition; // The source partition.
         private readonly bool[] m_consumerWaiting; // Whether a consumer is waiting on a particular producer
         private readonly bool[] m_producerWaiting; // Whether a particular producer is waiting on the consumer
@@ -83,7 +85,9 @@ namespace System.Linq.Parallel
             m_partitionIndex = partitionIndex;
             m_buffers = buffers;
             m_bufferLock = bufferLock;
+#if !MONO
             m_taskScheduler = taskScheduler;
+#endif
             m_autoBuffered = autoBuffered;
         }
 
index fb355997295e4dd81c1b737c9e92cfe08bf2e2a2..5007e479c7408a2113cb2c72b317c21657e92d15 100644 (file)
@@ -70,11 +70,15 @@ namespace System.Linq.Parallel
             Contract.Assert(sharedkeys != null);
             Contract.Assert(sharedValues != null);
             Contract.Assert(sharedBarriers != null);
+#if !MONO
             Contract.Assert(groupState.CancellationState.MergedCancellationToken != null);
+#endif
             Contract.Assert(sharedIndices.Length <= sharedkeys.Length);
             Contract.Assert(sharedIndices.Length == sharedValues.Length);
             Contract.Assert(sharedIndices.Length == sharedBarriers.GetLength(1));
+#if !MONO            
             Contract.Assert(groupState.CancellationState.MergedCancellationToken != null);
+#endif
 
             m_source = source;
             m_partitionCount = partitionCount;
index c26925aae8d8822feed0d0973f7da72d685d745d..365a490d06d1eec87ccc94e0e0145bd367b23ca1 100644 (file)
@@ -101,7 +101,9 @@ namespace System.Linq {
         object IQueryProvider.Execute(Expression expression){
             if (expression == null)
                 throw Error.ArgumentNull("expression");
+#if !MONO
             Type execType = typeof(EnumerableExecutor<>).MakeGenericType(expression.Type);
+#endif
             return EnumerableExecutor.Create(expression).ExecuteBoxed();
         }
 
@@ -194,7 +196,9 @@ namespace System.Linq {
 
             // check for args changed
             if (obj != m.Object || args != m.Arguments) {
+#if !MONO
                 Expression[] argArray = args.ToArray();
+#endif
                 Type[] typeArgs = (m.Method.IsGenericMethod) ? m.Method.GetGenericArguments() : null;
 
                 if ((m.Method.IsStatic || m.Method.DeclaringType.IsAssignableFrom(obj.Type)) 
index c36cb152e95807dc20cc19a6a001a1b7c2cc8802..bf5a3cb3e525bf43470435effd249ac53d7dc5e7 100644 (file)
@@ -67,7 +67,6 @@ namespace System.Runtime.Serialization
                         nodes[i].WriteTo(xmlWriter);
         }
 
-#if !MOBILE
         internal static string AddDefaultSchemaMethodName = "AddDefaultSchema";
         public static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName)
         {
@@ -77,6 +76,5 @@ namespace System.Runtime.Serialization
                 throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("typeQName");
             SchemaExporter.AddDefaultXmlType(schemas, typeQName.Name, typeQName.Namespace);
         }
-#endif
     }
 }
index 1d92faa541f6a2d6c5a5700a11dc0113895d3e89..506c90a59d6cb5cdf050ab20aa639faf9fb7737e 100644 (file)
@@ -4,6 +4,10 @@
 // </copyright>
 //------------------------------------------------------------------------------
 
+#if MONO
+#undef FEATURE_PAL
+#endif
+
 namespace System.Net.Sockets {
     using System.Collections;
     using System.Collections.Generic;
@@ -24,9 +28,9 @@ namespace System.Net.Sockets {
     ///    interface.</para>
     /// </devdoc>
 
-
-    public class Socket : IDisposable
+    public partial class Socket : IDisposable
     {
+#if !MONO
         internal const int DefaultCloseTimeout = -1; // don't change for default, otherwise breaking change
 
         // AcceptQueue - queued list of accept requests for BeginAccept or async Result for Begin Connect
@@ -81,12 +85,12 @@ namespace System.Net.Sockets {
         //
         // Overlapped constants.
         //
-#if !FEATURE_PAL || CORIOLIS
+#if !(FEATURE_PAL && !MONO) || CORIOLIS
         internal static volatile bool UseOverlappedIO;
 #else
         // Disable the I/O completion port for Rotor
         internal static volatile bool UseOverlappedIO = true;
-#endif // !FEATURE_PAL || CORIOLIS
+#endif // !(FEATURE_PAL && !MONO) || CORIOLIS
         private bool useOverlappedIO;
 
         // Bool marked true if the native socket m_Handle was bound to the ThreadPool
@@ -120,6 +124,7 @@ namespace System.Net.Sockets {
 #if !FEATURE_PAL // perfcounter
         internal static volatile bool s_PerfCountersEnabled;
 #endif
+#endif // !MONO
 
 //************* constructors *************************
 
@@ -131,6 +136,7 @@ namespace System.Net.Sockets {
             DualMode = true;
         }
 
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Initializes a new instance of the <see cref='Sockets.Socket'/> class.
@@ -475,6 +481,7 @@ namespace System.Net.Sockets {
                 return m_RemoteEndPoint;
             }
         }
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>
@@ -484,10 +491,13 @@ namespace System.Net.Sockets {
         /// </devdoc>
         public IntPtr Handle {
             get {
+#if !MONO
                 ExceptionHelper.UnmanagedPermission.Demand();
+#endif
                 return m_Handle.DangerousGetHandle();
             }
         }
+#if !MONO
         internal SafeCloseSocket SafeHandle {
             get {
                 return m_Handle;
@@ -534,6 +544,7 @@ namespace System.Net.Sockets {
                 willBlock = current;
             }
         }
+#endif // !MONO
 
         public bool UseOnlyOverlappedIO{
             get {
@@ -544,16 +555,17 @@ namespace System.Net.Sockets {
 
             }
             set {
-
+#if !MONO
                 if (m_BoundToThreadPool) {
                     throw new InvalidOperationException(SR.GetString(SR.net_io_completionportwasbound));
                 }
+#endif
 
                 useOverlappedIO = value;
             }
         }
 
-
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Gets the connection state of the Socket. This property will return the latest
@@ -577,6 +589,7 @@ namespace System.Net.Sockets {
                 return m_IsConnected;
             }
         }
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>
@@ -611,13 +624,13 @@ namespace System.Net.Sockets {
             }
         }
 
-
+#if !MONO
         public bool IsBound{
             get{
                 return (m_RightEndPoint != null);
             }
         }
-
+#endif // !MONO
 
         public bool ExclusiveAddressUse{
             get {
@@ -707,6 +720,7 @@ namespace System.Net.Sockets {
             }
         }
 
+#if !MONO
         public bool NoDelay {
             get {
                 return (int)GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay) != 0 ? true : false;
@@ -715,6 +729,7 @@ namespace System.Net.Sockets {
                 SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
             }
         }
+#endif // !MONO
 
         public short Ttl{
             get {
@@ -769,6 +784,7 @@ namespace System.Net.Sockets {
             }
         }
 
+#if !MONO
         public bool MulticastLoopback{
             get {
                 if (addressFamily == AddressFamily.InterNetwork) {
@@ -796,7 +812,6 @@ namespace System.Net.Sockets {
             }
         }
 
-
         public bool EnableBroadcast{
             get {
                 return (int)GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast) != 0 ? true : false;
@@ -805,7 +820,8 @@ namespace System.Net.Sockets {
                 SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
             }
         }
-                
+#endif // !MONO
+
         public bool DualMode {
             get {
                 if (AddressFamily != AddressFamily.InterNetworkV6) {
@@ -837,7 +853,7 @@ namespace System.Net.Sockets {
 
 
 
-
+#if !MONO
         /// <devdoc>
         ///    <para>Associates a socket with an end point.</para>
         /// </devdoc>
@@ -1258,7 +1274,7 @@ namespace System.Net.Sockets {
             }
             return socket;
         }
-
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>Sends a data buffer to a connected socket.</para>
@@ -1300,7 +1316,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
-
+#if !MONO
         public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Send", "");
             if (CleanedUp) {
@@ -1392,8 +1408,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Send", bytesTransferred);
             return bytesTransferred;
         }
-
-
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>Sends a file to
@@ -1406,8 +1421,7 @@ namespace System.Net.Sockets {
             SendFile(fileName,null,null,TransmitFileOptions.UseDefaultWorkerThread);
         }
 
-
-
+#if !MONO
         /// <devdoc>
         ///    <para>Sends a file to
         ///       a connected socket.</para>
@@ -1492,6 +1506,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "SendFile", errorCode);
             return;
         }
+#endif // !MONO
 #endif // !FEATURE_PAL
 
 
@@ -1511,8 +1526,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
-
-
+#if !MONO
         public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Send", "");
 
@@ -1688,6 +1702,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "SendTo", bytesTransferred);
             return bytesTransferred;
         }
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>Sends data to a specific end point, starting at the indicated location in the data.</para>
@@ -1695,12 +1710,14 @@ namespace System.Net.Sockets {
         public int SendTo(byte[] buffer, int size, SocketFlags socketFlags, EndPoint remoteEP) {
             return SendTo(buffer, 0, size, socketFlags, remoteEP);
         }
+
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
         public int SendTo(byte[] buffer, SocketFlags socketFlags, EndPoint remoteEP) {
             return SendTo(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags, remoteEP);
         }
+
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
@@ -1742,7 +1759,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
-
+#if !MONO
         public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Receive", "");
             if (CleanedUp) {
@@ -1820,7 +1837,7 @@ namespace System.Net.Sockets {
 
             return bytesTransferred;
         }
-
+#endif // !MONO
 
         public int Receive(IList<ArraySegment<byte>> buffers) {
             return Receive(buffers,SocketFlags.None);
@@ -1836,6 +1853,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
+#if !MONO
         public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Receive", "");
             if (CleanedUp) {
@@ -2153,8 +2171,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "ReceiveFrom", bytesTransferred);
             return bytesTransferred;
         }
-
-
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>Receives a datagram and stores the source end point.</para>
@@ -2175,6 +2192,7 @@ namespace System.Net.Sockets {
             return ReceiveFrom(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None, ref remoteEP);
         }
 
+#if !MONO
         // UE
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
@@ -2220,6 +2238,7 @@ namespace System.Net.Sockets {
 
             return realOptionLength;
         }
+#endif // !MONO
 
         // UE
         /// <devdoc>
@@ -2229,6 +2248,7 @@ namespace System.Net.Sockets {
             return IOControl(unchecked((int)ioControlCode),optionInValue,optionOutValue);
         }
 
+#if !MONO
         internal int IOControl(        IOControlCode ioControlCode, 
                                                                        IntPtr optionInValue, 
                                                                        int inValueSize,
@@ -2273,6 +2293,7 @@ namespace System.Net.Sockets {
 
             return realOptionLength;
         }
+#endif // !MONO
 
         public void SetIPProtectionLevel(IPProtectionLevel level) {
             if (level == IPProtectionLevel.Unspecified) {
@@ -2290,6 +2311,7 @@ namespace System.Net.Sockets {
             }
         }
 
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Sets the specified option to the specified value.
@@ -2660,6 +2682,7 @@ namespace System.Net.Sockets {
             SelectFileDescriptor(checkWrite, writefileDescriptorSet);
             SelectFileDescriptor(checkError, errfileDescriptorSet);
         }
+#endif // !MONO
 
 #if !FEATURE_PAL
         /// <devdoc>
@@ -2678,7 +2701,7 @@ namespace System.Net.Sockets {
         }
 #endif
 
-
+#if !MONO
         //
         // Async Winsock Support, the following functions use either
         //   the Async Winsock support to do overlapped I/O WSASend/WSARecv
@@ -3100,6 +3123,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "BeginConnect", result);
             return result;
         }
+#endif // !MONO
 
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, object state){
@@ -3124,6 +3148,7 @@ namespace System.Net.Sockets {
             return result;
         }
 
+#if !MONO
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
         {
@@ -3193,7 +3218,7 @@ namespace System.Net.Sockets {
 
             GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::DoBeginDisconnect() ");
 
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
             throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
 #endif
 
@@ -3242,9 +3267,9 @@ namespace System.Net.Sockets {
                  throw new ObjectDisposedException(this.GetType().FullName);
              }
 
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
             throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
 
 
              GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::Disconnect() ");
@@ -3370,9 +3395,9 @@ namespace System.Net.Sockets {
                throw new ObjectDisposedException(this.GetType().FullName);
              }
 
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
             throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
 
              if (asyncResult==null) {
                throw new ArgumentNullException("asyncResult");
@@ -3412,7 +3437,7 @@ namespace System.Net.Sockets {
              if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndDisconnect", null);
              return;
         }
-
+#endif // !MONO
 
         /*++
 
@@ -3451,6 +3476,7 @@ namespace System.Net.Sockets {
             return result;
         }
 
+#if !MONO
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
         {
@@ -3620,9 +3646,9 @@ namespace System.Net.Sockets {
                 throw new ObjectDisposedException(this.GetType().FullName);
             }
 
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
             throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
 
 
             if (!Connected) {
@@ -3698,7 +3724,7 @@ namespace System.Net.Sockets {
         }
 
 #endif // !FEATURE_PAL
-
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
@@ -3714,7 +3740,7 @@ namespace System.Net.Sockets {
             return result;
         }
 
-
+#if !MONO
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
         {
@@ -3804,7 +3830,7 @@ namespace System.Net.Sockets {
             }
             return errorCode;
         }
-
+#endif // !MONO
 
         /*++
 
@@ -3836,7 +3862,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
-
+#if !MONO
         public int EndSend(IAsyncResult asyncResult, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndSend", asyncResult);
             if (CleanedUp) {
@@ -3904,9 +3930,9 @@ namespace System.Net.Sockets {
                 throw new ObjectDisposedException(this.GetType().FullName);
             }
 
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
             throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
             //
             // parameter validation
             //
@@ -4160,7 +4186,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndSendTo", bytesTransferred);
             return bytesTransferred;
         }
-
+#endif // !MONO
 
         /*++
 
@@ -4206,6 +4232,7 @@ namespace System.Net.Sockets {
         }
 
 
+#if !MONO
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
         {
@@ -4329,7 +4356,7 @@ namespace System.Net.Sockets {
 
             return errorCode;
         }
-
+#endif // !MONO
 
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
@@ -4342,7 +4369,7 @@ namespace System.Net.Sockets {
             return result;
         }
 
-
+#if !MONO
         [HostProtection(ExternalThreading=true)]
         public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
         {
@@ -4451,6 +4478,8 @@ namespace System.Net.Sockets {
         private int m_LastReceiveTick;
 #endif
 
+#endif // !MONO
+
         /*++
 
         Routine Description:
@@ -4481,7 +4510,7 @@ namespace System.Net.Sockets {
             return bytesTransferred;
         }
 
-
+#if !MONO
         public int EndReceive(IAsyncResult asyncResult, out SocketError errorCode) {
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndReceive", asyncResult);
             if (CleanedUp) {
@@ -5342,8 +5371,10 @@ namespace System.Net.Sockets {
                 }
             }
         }
+#endif // !MONO
 
 #if !FEATURE_PAL
+#if !MONO
         private bool CanUseAcceptEx
         {
             get
@@ -5352,6 +5383,7 @@ namespace System.Net.Sockets {
                     (Thread.CurrentThread.IsThreadPoolThread || SettingsSectionInternal.Section.AlwaysUseCompletionPortsForAccept || m_IsDisconnected);
             }
         }
+#endif // !MONO
 
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
@@ -5363,6 +5395,7 @@ namespace System.Net.Sockets {
 
         ///  This is the true async version that uses AcceptEx
 
+#if !MONO
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
@@ -5461,10 +5494,9 @@ namespace System.Net.Sockets {
                 throw socketException;
             }
         }
-
+#endif // !MONO
 #endif // !FEATURE_PAL
 
-
         /*++
 
         Routine Description:
@@ -5483,6 +5515,7 @@ namespace System.Net.Sockets {
 
         --*/
 
+#if !MONO
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
@@ -5552,9 +5585,9 @@ namespace System.Net.Sockets {
             }
             return acceptedSocket;
         }
+#endif // !MONO
 
 #if !FEATURE_PAL
-
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
@@ -5569,6 +5602,7 @@ namespace System.Net.Sockets {
             return socket;
         }
 
+#if !MONO
         /// <devdoc>
         ///    <para>[To be supplied.]</para>
         /// </devdoc>
@@ -5635,13 +5669,13 @@ namespace System.Net.Sockets {
             }
             return socket;
         }
-
+#endif // !MONO
 #endif // !FEATURE_PAL
 
 
 
 
-
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Disables sends and receives on a socket.
@@ -5821,6 +5855,7 @@ namespace System.Net.Sockets {
                 Interlocked.CompareExchange(ref m_AcceptQueueOrConnectResult, new Queue(16), null);
             return (Queue)m_AcceptQueueOrConnectResult;
         }
+#endif // !MONO
 
         internal bool CleanedUp {
             get {
@@ -5828,6 +5863,7 @@ namespace System.Net.Sockets {
             }
         }
 
+#if !MONO
         internal TransportType Transport {
             get {
                 return
@@ -6330,6 +6366,7 @@ namespace System.Net.Sockets {
                 m_AsyncEvent.Close();
             }
         }
+#endif // !MONO
 
         public void Dispose() {
             Dispose(true);
@@ -6340,6 +6377,7 @@ namespace System.Net.Sockets {
             Dispose(false);
         }
 
+#if !MONO
         // this version does not throw.
         internal void InternalShutdown(SocketShutdown how) {
             GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::InternalShutdown() how:" + how.ToString());
@@ -8350,10 +8388,10 @@ namespace System.Net.Sockets {
 
             return retval;
         }
-
+#endif // !MONO
     }  // end of class Socket
 
-
+#if !MONO
     internal class ConnectAsyncResult:ContextAwareResult{
         private EndPoint m_EndPoint;
         internal ConnectAsyncResult(object myObject, EndPoint endPoint, object myState, AsyncCallback myCallBack):base(myObject, myState, myCallBack) {
@@ -10234,5 +10272,6 @@ namespace System.Net.Sockets {
         }
     }
 #endif // SOCKETTHREADPOOL
+#endif // !MONO
 
 }
index 7b9b1e1911554202ca41795357d004fc2f7dfe04..4675771138671184da9cab61a354f3441eebb24c 100644 (file)
@@ -473,6 +473,7 @@ namespace System.Text.RegularExpressions {
         }
 
 #if NETSTANDARD
+        [CLSCompliant (false)]
         protected IDictionary Caps
         {
             get
@@ -500,6 +501,7 @@ namespace System.Text.RegularExpressions {
             }
         }
 
+        [CLSCompliant (false)]
         protected IDictionary CapNames
         {
             get
@@ -1398,7 +1400,7 @@ namespace System.Text.RegularExpressions {
             return newcached;
         }
 
-#if !(SILVERLIGHT||FULL_AOT_RUNTIME)
+#if !SILVERLIGHT
         /*
          * True if the O option was set
          */
@@ -1408,7 +1410,11 @@ namespace System.Text.RegularExpressions {
         protected bool UseOptionC() {
                /* Mono: Set to false until we investigate  https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
            return false;
+#if FULL_AOT_RUNTIME
+            return false;
+#else
             return(roptions & RegexOptions.Compiled) != 0;
+#endif
         }
 #endif
 
index ef960754ba860b5776c94f68ad708ae04079cfed..85d996b827a588a47f18ea4782bcb9f4981d4419 100644 (file)
@@ -53,6 +53,270 @@ namespace System.Diagnostics {
         public void CopyTo(ProcessModule[] array, int index) {
             InnerList.CopyTo(array, index);
         }
+
+#if MOBILE
+        [Obsolete ("This API is no longer available", true)]
+        public int Capacity {
+            get {
+                throw new NotSupportedException ();
+            }
+            set {
+                throw new NotSupportedException ();
+            }
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Add (ProcessModule item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void AddRange (System.Collections.Generic.IEnumerable<ProcessModule> collection)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.ObjectModel.ReadOnlyCollection<ProcessModule> AsReadOnly()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(int index, int count, ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(ProcessModule item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Clear()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessModule,TOutput> converter)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void CopyTo(ProcessModule[] array)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void CopyTo(int index, ProcessModule[] array, int arrayIndex, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public bool Exists(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessModule Find(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<ProcessModule> FindAll(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(int startIndex, Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(int startIndex, int count, Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessModule FindLast(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(int startIndex, Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(int startIndex, int count, Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void ForEach(Action<ProcessModule> action)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<ProcessModule> GetRange(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int IndexOf(ProcessModule item, int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int IndexOf(ProcessModule item, int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Insert(int index, ProcessModule item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessModule> collection)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessModule item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessModule item, int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessModule item, int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public bool Remove(ProcessModule item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int RemoveAll(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void RemoveAt(int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void RemoveRange(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Reverse()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Reverse(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(System.Collections.Generic.IComparer<ProcessModule> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessModule> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(Comparison<ProcessModule> comparison)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessModule[] ToArray()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void TrimExcess()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public bool TrueForAll(Predicate<ProcessModule> match)
+        {
+            throw new NotSupportedException ();
+        }
+#endif
     }
 }
 
index 127c1d4319a7ea32bd83a47eb3d1d3ac0f3e45ea..94fa2f43bbd193043baafbb83bffb528e9ca27ba 100644 (file)
@@ -77,6 +77,252 @@ namespace System.Diagnostics {
         public void CopyTo(ProcessThread[] array, int index) {
             InnerList.CopyTo(array, index);
         }
+
+#if MOBILE
+        [Obsolete ("This API is no longer available", true)]
+        public int Capacity {
+            get {
+                throw new NotSupportedException ();
+            }
+            set {
+                throw new NotSupportedException ();
+            }
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void AddRange (System.Collections.Generic.IEnumerable<ProcessThread> collection)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.ObjectModel.ReadOnlyCollection<ProcessThread> AsReadOnly()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(int index, int count, ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(ProcessThread item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int BinarySearch(ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Clear()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessThread,TOutput> converter)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void CopyTo(ProcessThread[] array)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void CopyTo(int index, ProcessThread[] array, int arrayIndex, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public bool Exists(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessThread Find(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<ProcessThread> FindAll(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(int startIndex, Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindIndex(int startIndex, int count, Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessThread FindLast(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(int startIndex, Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int FindLastIndex(int startIndex, int count, Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void ForEach(Action<ProcessThread> action)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public System.Collections.Generic.List<ProcessThread> GetRange(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int IndexOf(ProcessThread item, int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int IndexOf(ProcessThread item, int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessThread> collection)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessThread item)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessThread item, int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int LastIndexOf(ProcessThread item, int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public int RemoveAll(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void RemoveAt(int index)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void RemoveRange(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Reverse()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Reverse(int index, int count)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(System.Collections.Generic.IComparer<ProcessThread> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessThread> comparer)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void Sort(Comparison<ProcessThread> comparison)
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public ProcessThread[] ToArray()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public void TrimExcess()
+        {
+            throw new NotSupportedException ();
+        }
+
+        [Obsolete ("This API is no longer available", true)]
+        public bool TrueForAll(Predicate<ProcessThread> match)
+        {
+            throw new NotSupportedException ();
+        }
+#endif
         
     }
 }
index b0290241aa4f877917c8b3bb88c20e8ec9aaba3f..f7298b8d117d32e6ffc08d38a4682c28d71efcd4 100644 (file)
@@ -20,7 +20,7 @@ namespace System {
     using System.Security.Permissions;
     [Serializable]
     [System.Runtime.InteropServices.ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class ContextBoundObject : MarshalByRefObject {
 #else // FEATURE_REMOTING
     public abstract class ContextBoundObject {
index 2402d9d2bdec1d287f5612c413bc2c3f101c9b46..cb2f144af24ceedf715ef302761a5fc7db00ae61 100644 (file)
@@ -17,7 +17,7 @@
 ===========================================================*/
 
 using System;
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
 using System.Security.AccessControl;
 #endif
 using System.Security.Permissions;
@@ -226,7 +226,7 @@ namespace System.IO {
             }
         }
 
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
         [ResourceExposure(ResourceScope.None)]
         [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
         public FileSecurity GetAccessControl()
index aab4fe9497568f6ad79cd7d0ceb1a50f9d4f01e1..2db4c807d8797f45a97f136996d363d3b6b47ef1 100644 (file)
@@ -34,7 +34,7 @@ namespace System.IO {
     [FileIOPermissionAttribute(SecurityAction.InheritanceDemand,Unrestricted=true)]
 #endif
     [ComVisible(true)]
-#if FEATURE_REMOTING        
+#if FEATURE_REMOTING || MONO
     public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
 #else // FEATURE_REMOTING
     public abstract class FileSystemInfo : ISerializable {   
index 007745c7ab57d6979632e580b69c75f901908af5..fa022e96e5d8fc29a94d34b28c2212e6eadd28f1 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
 #if CONTRACTS_FULL
     [ContractClass(typeof(StreamContract))]
 #endif
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class Stream : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class Stream : IDisposable {
index 5f8e7b98a7d8240203fc1deb2db8526bd4299c58..9023902cbfc3403426645684534b05089e24115c 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
     // There are methods on the Stream class for reading bytes. 
     [Serializable]
     [ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class TextReader : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class TextReader : IDisposable {
index 2afe3a6cbfae4d9751a6ceb27ad2343f4fb54259..3f484ffaddb1d5ebea09a176058b4b04274ff4f4 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
     // There are methods on the Stream class for writing bytes. 
     [Serializable]
     [ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class TextWriter : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class TextWriter : IDisposable {
index 0e7bfafaf9e7bec12929f3349b607f1211c53ddc..b82294c787ba14115fb78a1ba897b19c3dd738a2 100644 (file)
@@ -34,7 +34,7 @@ namespace System.Runtime.Serialization.Formatters.Binary {
     
     [System.Runtime.InteropServices.ComVisible(true)]
     sealed public class BinaryFormatter :
-#if !FEATURE_REMOTING
+#if !FEATURE_REMOTING && !MONO
         IFormatter
 #else
         IRemotingFormatter 
index cd8b165baaf1c6e2c0781e66122bb49a56f82f80..090998e0a51b276b05e83722d12818ab5f4f451a 100644 (file)
@@ -86,12 +86,12 @@ namespace System.Security
     {
 #pragma warning disable 618    // We still use SecurityCriticalScope for v2 compat
 
-#if !FEATURE_CORECLR && !MOBILE
+#if !FEATURE_CORECLR
          private SecurityCriticalScope  _val;
 #endif // FEATURE_CORECLR
         public SecurityCriticalAttribute () {}
 
-#if !FEATURE_CORECLR && !MOBILE
+#if !FEATURE_CORECLR
         public SecurityCriticalAttribute(SecurityCriticalScope scope)
         {
             _val = scope;
index 60046c7dba2ff68d34dbc612b28405e125b430b3..3063b06aed614150203337276bab3c04169751b2 100644 (file)
@@ -39,12 +39,11 @@ namespace System.Threading
             : base(info, context) 
         {
         }
-#if !MOBILE
+
         public Object ExceptionState 
         {
             [System.Security.SecuritySafeCritical]  // auto-generated
             get {return Thread.CurrentThread.AbortReason;}
         }
-#endif
     }
 }
index 63ddee82bfa286db0e183495ef80d6a93e4d5b90..fea30ff25c6d0e4846b95d8fedb86605285138c2 100644 (file)
@@ -3276,13 +3276,13 @@ exptype_head            : D_CLASS K_EXTERN expt_attr comp_name
 expt_attr              : { $$ = 0; } /* EMPTY */\r
                        | expt_attr K_PRIVATE                   { $$ = (TypeAttr)$1 | TypeAttr.Private; }\r
                        | expt_attr K_PUBLIC                    { $$ = (TypeAttr)$1 | TypeAttr.Public; }\r
+                       | expt_attr K_FORWARDER                 { $$ = (TypeAttr)$1 | TypeAttr.Forwarder; }\r
                        | expt_attr K_NESTED K_PUBLIC           { $$ = (TypeAttr)$1 | TypeAttr.NestedPublic; }\r
                        | expt_attr K_NESTED K_PRIVATE          { $$ = (TypeAttr)$1 | TypeAttr.NestedPrivate; }\r
                        | expt_attr K_NESTED K_FAMILY           { $$ = (TypeAttr)$1 | TypeAttr.NestedFamily; }\r
                        | expt_attr K_NESTED K_ASSEMBLY         { $$ = (TypeAttr)$1 | TypeAttr.NestedAssembly;}\r
                        | expt_attr K_NESTED K_FAMANDASSEM      { $$ = (TypeAttr)$1 | TypeAttr.NestedFamAndAssem; }\r
                        | expt_attr K_NESTED K_FAMORASSEM       { $$ = (TypeAttr)$1 | TypeAttr.NestedFamOrAssem; }\r
-                       | K_FORWARDER                           { $$ = TypeAttr.Forwarder; }\r
                        ;\r
 \r
 exptype_decls          : /* EMPTY */\r
diff --git a/mcs/tests/test-16628-lib.il b/mcs/tests/test-16628-lib.il
new file mode 100644 (file)
index 0000000..ca46405
--- /dev/null
@@ -0,0 +1,33 @@
+.assembly bz16628.typeforwarder2 {}
+.assembly extern mscorlib {}
+.assembly extern bz16628.typeforwardee2 {}
+
+.class extern public forwarder NSwForwardee2.Foo_SPECIAL{
+       .assembly extern bz16628.typeforwardee2
+}
+
+.class public auto ansi beforefieldinit NSwForwardee2.Bar_SPECIAL
+       extends [mscorlib]System.Object
+{
+  .field public static int32 A
+  .method public hidebysig specialname rtspecialname 
+          instance void  .ctor() cil managed
+  {
+    // Code size       7 (0x7)
+    .maxstack  8
+    IL_0000:  ldarg.0
+    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
+    IL_0006:  ret
+  } // end of method Foo::.ctor
+
+  .method private hidebysig specialname rtspecialname static 
+          void  .cctor() cil managed
+  {
+    // Code size       8 (0x8)
+    .maxstack  8
+    IL_0000:  ldc.i4.s   320
+    IL_0002:  stsfld     int32 NSwForwardee2.Bar_SPECIAL::A
+    IL_0007:  ret
+  } // end of method Foo::.cctor
+} 
+
index a755892f40980f7ea540c794292a897cac3770c2..cf6b17771074300da5e30245ccf685e92d93488a 100644 (file)
@@ -1541,13 +1541,13 @@ namespace CorCompare
 
                                ParameterDefinition info = infos [i];
 
-                               string modifier;
-                               if ((info.Attributes & ParameterAttributes.In) != 0)
-                                       modifier = string.Empty;
-                               else if ((info.Attributes & ParameterAttributes.Out) != 0 && info.ParameterType.IsByReference)
-                                       modifier = "out";
-                               else
-                                       modifier = string.Empty;
+                               string modifier = string.Empty;
+                               if (info.ParameterType.IsByReference) {
+                                       if ((info.Attributes & ParameterAttributes.In) != 0)
+                                               modifier = "in";
+                                       else if ((info.Attributes & ParameterAttributes.Out) != 0)
+                                               modifier = "out";
+                               }
 
                                if (modifier.Length > 0) {
                                        signature.Append (modifier);
diff --git a/mcs/tools/xbuild/tests/Vbc/1.vbproj b/mcs/tools/xbuild/tests/Vbc/1.vbproj
new file mode 100644 (file)
index 0000000..c056fd1
--- /dev/null
@@ -0,0 +1,22 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
+       
+       <ItemGroup>
+               <Input Include="test.vb" />
+               <Output Include="test.exe" />
+       </ItemGroup>
+       
+       <Target Name="Compile1" >
+               <Vbc
+                       Sources="@(Input)"
+                        OutputAssembly="@(Output)"
+               />
+       </Target>
+       
+       <Target Name="Clean" >
+               <Delete Files="@(Output)" />
+       </Target>
+       
+       <Target Name="Execute" >
+               <Exec Command="@(Output)" />
+       </Target>
+</Project>
diff --git a/mcs/tools/xbuild/tests/Vbc/2.vbproj b/mcs/tools/xbuild/tests/Vbc/2.vbproj
new file mode 100644 (file)
index 0000000..517036a
--- /dev/null
@@ -0,0 +1,13 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTarget="Build">
+       
+       <ItemGroup>
+               <Input Include="test.vb" />
+               <Output Include="test.exe" />
+       </ItemGroup>
+       
+       <Target Name="Build" >
+               <Vbc
+                       Sources="@(Input)"
+               />
+       </Target>
+</Project>
diff --git a/mcs/tools/xbuild/tests/Vbc/test.vb b/mcs/tools/xbuild/tests/Vbc/test.vb
new file mode 100644 (file)
index 0000000..4f76bf6
--- /dev/null
@@ -0,0 +1,7 @@
+Imports System
+
+Public Module mainmod
+  Sub Main()
+    Console.WriteLine("Hello, world!")
+  End sub
+End Module
index 3b8d92bb84dcb72359e34fdeece13d464bef01b4..d541472ada7a675f588cbd457f4b44b5887ed3ee 100644 (file)
@@ -101,6 +101,7 @@ null_gc_sources = \
 common_sources = \
        $(platform_sources)     \
        assembly.c              \
+       assembly-internals.h    \
        attach.h                \
        attach.c                \
        cil-coff.h              \
@@ -225,7 +226,6 @@ common_sources = \
        handle.c        \
        handle.h        \
        w32mutex.h      \
-       w32mutex-utils.h        \
        w32semaphore.h  \
        w32event.h      \
        w32handle-namespace.h   \
index 13a545a67bb6b3f49605702a3fa52f135c822ee0..0608394ff10b1db34d66b3aefc98aee657cf0cb1 100644 (file)
@@ -84,7 +84,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 156
+#define MONO_CORLIB_VERSION 157
 
 typedef struct
 {
index d22f162085b376b1a0d7a64412e82acd8454b588..e7ee0517dd22bc28555975281b8c4820f4dd7f8d 100644 (file)
@@ -111,6 +111,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
        /*
         * Handle the case when we are called from a thread different from the main thread,
         * confusing libgc.
index b62d6155f91e3bd40e6c204c16bfd1b4eb94143b..a8e73da2776eadca38a16ba93e64332eccce2750 100644 (file)
@@ -1350,6 +1350,12 @@ mono_class_get_generic_container (MonoClass *klass);
 MonoGenericClass*
 mono_class_get_generic_class (MonoClass *klass);
 
+gpointer
+mono_class_alloc (MonoClass *klass, int size);
+
+gpointer
+mono_class_alloc0 (MonoClass *klass, int size);
+
 void
 mono_class_alloc_ext (MonoClass *klass);
 
index 6218589a88e3c47b96ecacfff2701e05e5035e7a..6a206188977b0af28ce7d607ddbbd2abd3d873f9 100644 (file)
@@ -1132,6 +1132,15 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
        result->sre_method = FALSE;
        result->signature = NULL;
 
+       if (method->wrapper_type) {
+               MonoMethodWrapper *mw = (MonoMethodWrapper*)method;
+               MonoMethodWrapper *resw = (MonoMethodWrapper*)result;
+               int len = GPOINTER_TO_INT (((void**)mw->method_data) [0]);
+
+               resw->method_data = (void **)g_malloc (sizeof (gpointer) * (len + 1));
+               memcpy (resw->method_data, mw->method_data, sizeof (gpointer) * (len + 1));
+       }
+
        if (iresult->context.method_inst) {
                /* Set the generic_container of the result to the generic_container of method */
                MonoGenericContainer *generic_container = mono_method_get_generic_container (method);
@@ -1424,7 +1433,7 @@ mono_error_set_for_class_failure (MonoError *oerror, MonoClass *klass)
  *   Allocate memory for some data belonging to CLASS, either from its image's mempool,
  * or from the heap.
  */
-static gpointer
+gpointer
 mono_class_alloc (MonoClass *klass, int size)
 {
        if (klass->generic_class)
@@ -1433,7 +1442,7 @@ mono_class_alloc (MonoClass *klass, int size)
                return mono_image_alloc (klass->image, size);
 }
 
-static gpointer
+gpointer
 mono_class_alloc0 (MonoClass *klass, int size)
 {
        gpointer res;
index 4be4c632d10e53115c39384faec8f8aa2d0ab2e6..44327aed131a7f85595486d2465e19293180d58f 100644 (file)
@@ -45,6 +45,29 @@ Combine: MonoDefaults, GENERATE_GET_CLASS_WITH_CACHE, TYPED_HANDLE_DECL and frie
        We could then generate neat type safe wrappers.
 */
 
+/*
+ * NOTE: Async suspend
+ * 
+ * If we are running with cooperative GC, all the handle stack
+ * manipulation will complete before a GC thread scans the handle
+ * stack. If we are using async suspend, however, a thread may be
+ * trying to allocate a new handle, or unwind the handle stack when
+ * the GC stops the world.
+ *
+ * In particular, we need to ensure that if the mutator thread is
+ * suspended while manipulating the handle stack, the stack is in a
+ * good enough state to be scanned.  In particular, the size of each
+ * chunk should be updated before an object is written into the
+ * handle, and chunks to be scanned (between bottom and top) should
+ * always be valid.
+ *
+ * Note that the handle stack is scanned PRECISELY (see
+ * sgen_client_scan_thread_data ()).  That means there should not be
+ * stale objects scanned.  So when we manipulate the size of a chunk,
+ * wemust ensure that the newly scannable slot is either null or
+ * points to a valid value.
+ */
+
 const MonoObjectHandle mono_null_value_handle = NULL;
 
 #define THIS_IS_AN_OK_NUMBER_OF_HANDLES 100
@@ -59,13 +82,28 @@ mono_handle_new (MonoObject *object)
 
 retry:
        if (G_LIKELY (top->size < OBJECTS_PER_HANDLES_CHUNK)) {
-               MonoObject **h = &top->objects [top->size++];
+               int idx = top->size;
+               /* can be interrupted anywhere here, so:
+                * 1. make sure the new slot is null
+                * 2. make the new slot scannable (increment size)
+                * 3. put a valid object in there
+                *
+                * (have to do 1 then 3 so that if we're interrupted
+                * between 1 and 2, the object is still live)
+                */
+               top->objects [idx] = NULL;
+               mono_memory_write_barrier ();
+               top->size++;
+               mono_memory_write_barrier ();
+               MonoObject **h = &top->objects [idx];
                *h = object;
                return h;
        }
        if (G_LIKELY (top->next)) {
+               top->next->size = 0;
+               /* make sure size == 0 is visible to a GC thread before it sees the new top */
+               mono_memory_write_barrier ();
                top = top->next;
-               top->size = 0;
                handles->top = top;
                goto retry;
        }
@@ -73,6 +111,8 @@ retry:
        new_chunk->size = 0;
        new_chunk->prev = top;
        new_chunk->next = NULL;
+       /* make sure size == 0 before new chunk is visible */
+       mono_memory_write_barrier ();
        top->next = new_chunk;
        handles->top = new_chunk;
        goto retry;
@@ -86,9 +126,10 @@ mono_handle_stack_alloc (void)
        HandleStack *stack = g_new (HandleStack, 1);
        HandleChunk *chunk = g_new (HandleChunk, 1);
 
-       stack->top = stack->bottom = chunk;
        chunk->size = 0;
        chunk->prev = chunk->next = NULL;
+       mono_memory_write_barrier ();
+       stack->top = stack->bottom = chunk;
        return stack;
 }
 
@@ -98,6 +139,8 @@ mono_handle_stack_free (HandleStack *stack)
        if (!stack)
                return;
        HandleChunk *c = stack->bottom;
+       stack->top = stack->bottom = NULL;
+       mono_memory_write_barrier ();
        while (c) {
                HandleChunk *next = c->next;
                g_free (c);
@@ -110,6 +153,8 @@ mono_handle_stack_free (HandleStack *stack)
 void
 mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data)
 {
+       /* if we're running, we know the world is stopped.
+        */
        HandleChunk *cur = stack->bottom;
        HandleChunk *last = stack->top;
 
index 102f9f4da7244fbb8aac1b0909d239bd1a49b190..76a43969eba0dd99bd64b78cf7b5674444699784 100644 (file)
@@ -91,8 +91,9 @@ static inline void
 mono_stack_mark_pop (MonoThreadInfo *info, HandleStackMark *stackmark)
 {
        HandleStack *handles = (HandleStack *)info->handle_stack;
-       handles->top = stackmark->chunk;
        handles->top->size = stackmark->size;
+       mono_memory_write_barrier ();
+       handles->top = stackmark->chunk;
 }
 
 /*
index 66e0d4ba8957498188f7aa19890bff97535238fb..507c67244a750418461cd8a74f4660d0e10c4cdc 100644 (file)
@@ -556,7 +556,6 @@ ICALL(MODULEB_8, "RegisterToken", ves_icall_ModuleBuilder_RegisterToken)
 ICALL(MODULEB_1, "WriteToFile", ves_icall_ModuleBuilder_WriteToFile)
 ICALL(MODULEB_2, "basic_init", ves_icall_ModuleBuilder_basic_init)
 ICALL(MODULEB_3, "build_metadata", ves_icall_ModuleBuilder_build_metadata)
-ICALL(MODULEB_4, "create_modified_type", ves_icall_ModuleBuilder_create_modified_type)
 ICALL(MODULEB_5, "getMethodToken", ves_icall_ModuleBuilder_getMethodToken)
 ICALL(MODULEB_6, "getToken", ves_icall_ModuleBuilder_getToken)
 ICALL(MODULEB_7, "getUSIndex", ves_icall_ModuleBuilder_getUSIndex)
index 526ff5e075eb9d89ef3e46b5012820ca671fb064..4e5d773cb73447db0fb8e0f8cc4e80689d21b15b 100644 (file)
@@ -7393,6 +7393,7 @@ ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definiti
                klass = klass->generic_class->container_class;
        }
 
+retry:
        if (definition) {
                /* At the end of the loop, klass points to the eldest class that has this virtual function slot. */
                for (parent = klass->parent; parent != NULL; parent = parent->parent) {
@@ -7479,14 +7480,38 @@ ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definiti
        result = klass->vtable [slot];
        if (result == NULL) {
                /* It is an abstract method */
+               gboolean found = FALSE;
                gpointer iter = NULL;
-               while ((result = mono_class_get_methods (klass, &iter)))
-                       if (result->slot == slot)
+               while ((result = mono_class_get_methods (klass, &iter))) {
+                       if (result->slot == slot) {
+                               found = TRUE;
                                break;
+                       }
+               }
+               /* found might be FALSE if we looked in an abstract class
+                * that doesn't override an abstract method of its
+                * parent: 
+                *   abstract class Base {
+                *     public abstract void Foo ();
+                *   }
+                *   abstract class Derived : Base { }
+                *   class Child : Derived {
+                *     public override void Foo () { }
+                *  }
+                *
+                *  if m was Child.Foo and we ask for the base method,
+                *  then we get here with klass == Derived and found == FALSE
+                */
+               /* but it shouldn't be the case that if we're looking
+                * for the definition and didn't find a result; the
+                * loop above should've taken us as far as we could
+                * go! */
+               g_assert (!(definition && !found));
+               if (!found)
+                       goto retry;
        }
 
-       if (result == NULL)
-               return m;
+       g_assert (result != NULL);
 
        ret = mono_method_get_object_checked (mono_domain_get (), result, NULL, &error);
        mono_error_set_pending_exception (&error);
index 70e371aa66eadc61ccab56a8fc0e7f17b847c786..e2a91f0975fb4ee6dea5c401e23e545c8038dad3 100644 (file)
@@ -2141,8 +2141,6 @@ mono_method_get_wrapper_data (MonoMethod *method, guint32 id)
        g_assert (method != NULL);
        g_assert (method->wrapper_type != MONO_WRAPPER_NONE);
 
-       if (method->is_inflated)
-               method = ((MonoMethodInflated *) method)->declaring;
        data = (void **)((MonoMethodWrapper *)method)->method_data;
        g_assert (data != NULL);
        g_assert (id <= GPOINTER_TO_UINT (*data));
index b457211c83da5d2ffd2116bae62c9acb98e4e408..d12e345ca26f4f399373e70077e13595d9a9160d 100644 (file)
@@ -2691,6 +2691,11 @@ mono_marshal_method_from_wrapper (MonoMethod *wrapper)
                        return info->d.runtime_invoke.method;
                else
                        return NULL;
+       case MONO_WRAPPER_DELEGATE_INVOKE:
+               if (info)
+                       return info->d.delegate_invoke.method;
+               else
+                       return NULL;
        default:
                return NULL;
        }
index 27115ccc9c1b1e384c9245ff8e976882159a9ed1..f9e2bc514889b5f1fb78f1898467f7bbc2408ce1 100644 (file)
@@ -2789,6 +2789,9 @@ free_inflated_method (MonoMethodInflated *imethod)
        if (method->signature)
                mono_metadata_free_inflated_signature (method->signature);
 
+       if (method->wrapper_type)
+               g_free (((MonoMethodWrapper*)method)->method_data);
+
        g_free (method);
 }
 
index 1ab1e0ebb2d3279e98a411d2151779e1bdfc1062..0f47c00fa62f299a3e11d4016c37da9c420d1222 100644 (file)
@@ -26,6 +26,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
        memset (&cb, 0, sizeof (cb));
        /* TODO: This casts away an incompatible pointer type warning in the same
                 manner that boehm-gc does it. This is probably worth investigating
index b420ff75543492180fccb50bcbd5fe7e349d2b36..d643b57206a9edc4194b127fd6496da2e74ec508 100644 (file)
@@ -1801,9 +1801,6 @@ void
 ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
                                                                           MonoReflectionType *t);
 
-MonoReflectionType*
-ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, MonoString *smodifiers);
-
 void
 ves_icall_ModuleBuilder_basic_init (MonoReflectionModuleBuilder *moduleb);
 
index fdbc46a2cfbf6d0d72f7957a7a1bdec60f9a9733..4b6a5d355ef9e4aeb19226ec6b2ff0d687195017 100644 (file)
@@ -2970,6 +2970,10 @@ mono_gc_base_init (void)
 
        mono_counters_init ();
 
+#ifndef HOST_WIN32
+       mono_w32handle_init ();
+#endif
+
 #ifdef HEAVY_STATISTICS
        mono_counters_register ("los marked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_marked_cards);
        mono_counters_register ("los array cards scanned ", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_array_cards);
index d4d168da76691a76c3f041b40cf2c45dde95d775..b4a85f27fa4f6d899ad1f40a3e895e9eaabef393 100644 (file)
@@ -1787,7 +1787,7 @@ Socket_to_SOCKET (MonoObject *sockobj)
        MonoSafeHandle *safe_handle;
        MonoClassField *field;
        
-       field = mono_class_get_field_from_name (sockobj->vtable->klass, "safe_handle");
+       field = mono_class_get_field_from_name (sockobj->vtable->klass, "m_Handle");
        safe_handle = ((MonoSafeHandle *)(*(gpointer *)(((char *)sockobj) + field->offset)));
 
        if (safe_handle == NULL)
index c15bd42b74aabd2b63709a831bcd20cc338e128d..80ab849b688d80333b053d61eadd5eb34cc42372 100644 (file)
@@ -5220,77 +5220,6 @@ ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
        enumtype->type = t->type;
 }
 
-MonoReflectionType*
-ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, MonoString *smodifiers)
-{
-       MonoError error;
-       MonoReflectionType *ret;
-       MonoClass *klass;
-       int isbyref = 0, rank;
-       char *p;
-       char *str = mono_string_to_utf8_checked (smodifiers, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
-
-       klass = mono_class_from_mono_type (tb->type.type);
-       p = str;
-       /* logic taken from mono_reflection_parse_type(): keep in sync */
-       while (*p) {
-               switch (*p) {
-               case '&':
-                       if (isbyref) { /* only one level allowed by the spec */
-                               g_free (str);
-                               return NULL;
-                       }
-                       isbyref = 1;
-                       p++;
-
-                       g_free (str);
-
-                       ret = mono_type_get_object_checked (mono_object_domain (tb), &klass->this_arg, &error);
-                       mono_error_set_pending_exception (&error);
-
-                       return ret;
-               case '*':
-                       klass = mono_ptr_class_get (&klass->byval_arg);
-                       mono_class_init (klass);
-                       p++;
-                       break;
-               case '[':
-                       rank = 1;
-                       p++;
-                       while (*p) {
-                               if (*p == ']')
-                                       break;
-                               if (*p == ',')
-                                       rank++;
-                               else if (*p != '*') { /* '*' means unknown lower bound */
-                                       g_free (str);
-                                       return NULL;
-                               }
-                               ++p;
-                       }
-                       if (*p != ']') {
-                               g_free (str);
-                               return NULL;
-                       }
-                       p++;
-                       klass = mono_array_class_get (klass, rank);
-                       mono_class_init (klass);
-                       break;
-               default:
-                       break;
-               }
-       }
-
-       g_free (str);
-
-       ret = mono_type_get_object_checked (mono_object_domain (tb), &klass->byval_arg, &error);
-       mono_error_set_pending_exception (&error);
-
-       return ret;
-}
-
 void
 ves_icall_ModuleBuilder_basic_init (MonoReflectionModuleBuilder *moduleb)
 {
index 3ad4c53b921a65b03ba65022f3af609fc8234614..4a5029641218fe7804917a84c70c3fdc85eaf849 100644 (file)
@@ -219,6 +219,7 @@ typedef struct MonoAotCompile {
        gboolean gas_line_numbers;
        /* Whenever to emit an object file directly from llc */
        gboolean llvm_owriter;
+       gboolean llvm_owriter_supported;
        MonoImageWriter *w;
        MonoDwarfWriter *dwarf;
        FILE *fp;
@@ -879,6 +880,7 @@ arch_init (MonoAotCompile *acfg)
 {
        acfg->llc_args = g_string_new ("");
        acfg->as_args = g_string_new ("");
+       acfg->llvm_owriter_supported = TRUE;
 
        /*
         * The prefix LLVM likes to put in front of symbol names on darwin.
@@ -941,6 +943,10 @@ arch_init (MonoAotCompile *acfg)
 #ifdef MONOTOUCH
        acfg->global_symbols = TRUE;
 #endif
+
+#ifdef TARGET_ANDROID
+       acfg->llvm_owriter_supported = FALSE;
+#endif
 }
 
 #ifdef TARGET_ARM64
@@ -9963,16 +9969,23 @@ compile_asm (MonoAotCompile *acfg)
                wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
 #else
        // Default (linux)
-       char *args = g_strdup_printf ("%s -shared -o %s %s %s %s", LD_OPTIONS,
-               wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
-               wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
-
-       if (acfg->llvm) {
-               command = g_strdup_printf ("clang++ %s", args);
+       if (acfg->aot_opts.tool_prefix) {
+               /* Cross compiling */
+               command = g_strdup_printf ("\"%sld\" %s -shared -o %s %s %s %s", tool_prefix, LD_OPTIONS,
+                                                                  wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
+                                                                  wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
        } else {
-               command = g_strdup_printf ("\"%sld\" %s", tool_prefix, args);
+               char *args = g_strdup_printf ("%s -shared -o %s %s %s %s", LD_OPTIONS,
+                                                                         wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
+                                                                         wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
+
+               if (acfg->llvm) {
+                       command = g_strdup_printf ("clang++ %s", args);
+               } else {
+                       command = g_strdup_printf ("\"%sld\" %s", tool_prefix, args);
+               }
+               g_free (args);
        }
-       g_free (args);
 
 #endif
        aot_printf (acfg, "Executing the native linker: %s\n", command);
@@ -10500,19 +10513,6 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                        aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outputfile= option.");
                        return 1;
                }
-
-               /*
-                * Emit all LLVM code into a separate assembly/object file and link with it
-                * normally.
-                */
-               if (!acfg->aot_opts.asm_only) {
-                       acfg->llvm_owriter = TRUE;
-               } else if (acfg->aot_opts.llvm_outfile) {
-                       int len = strlen (acfg->aot_opts.llvm_outfile);
-
-                       if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
-                               acfg->llvm_owriter = TRUE;
-               }
        }
 
        if (mono_aot_mode_is_full (&acfg->aot_opts))
@@ -10545,6 +10545,22 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 
        arch_init (acfg);
 
+       if (mono_use_llvm || acfg->aot_opts.llvm) {
+
+               /*
+                * Emit all LLVM code into a separate assembly/object file and link with it
+                * normally.
+                */
+               if (!acfg->aot_opts.asm_only && acfg->llvm_owriter_supported) {
+                       acfg->llvm_owriter = TRUE;
+               } else if (acfg->aot_opts.llvm_outfile) {
+                       int len = strlen (acfg->aot_opts.llvm_outfile);
+
+                       if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
+                               acfg->llvm_owriter = TRUE;
+               }
+       }
+
        if (acfg->llvm && acfg->thumb_mixed)
                acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_LLVM_THUMB);
        if (acfg->aot_opts.llvm_only)
index 9a4d566c754d088e31d81b3679ad2617c3fd6532..0da4ad6168d75584271a6ed781aac682d494c79d 100644 (file)
@@ -4025,32 +4025,6 @@ find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32
                        break;
                }
 
-               /*
-                * Special case: wrappers of shared generic methods.
-                * This is needed because of the way mini_get_shared_method () works,
-                * we could end up with multiple copies of the same wrapper.
-                */
-               if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
-                       method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
-                       MonoMethod *w1 = mono_marshal_method_from_wrapper (method);
-                       MonoMethod *w2 = mono_marshal_method_from_wrapper (m);
-
-                       if ((w1 == w2) || (w1->is_inflated && ((MonoMethodInflated *)w1)->declaring == w2)) {
-                               index = value;
-                               break;
-                       }
-               }
-               if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
-                       method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
-                       WrapperInfo *info1 = mono_marshal_get_wrapper_info (method);
-                       WrapperInfo *info2 = mono_marshal_get_wrapper_info (m);
-
-                       if (info1 && info2 && info1->subtype == info2->subtype && info1->d.delegate_invoke.method == info2->d.delegate_invoke.method) {
-                               index = value;
-                               break;
-                       }
-               }
-
                /* Methods decoded needlessly */
                if (m) {
                        //printf ("%d %s %s %p\n", n_extra_decodes, mono_method_full_name (method, TRUE), mono_method_full_name (m, TRUE), orig_p);
index a6d2bd117b1f75181421b9e0b65ddb23265e5fd7..6e06724a9f0ea42b1cdbde2ee17b88333099c2d2 100644 (file)
@@ -1500,6 +1500,7 @@ switch_gc (char* argv[], const char* target_gc)
 
 #ifdef HAVE_EXECVP
        execvp (path->str, argv);
+       fprintf (stderr, "Error: Failed to switch to %s gc. mono-%s is not installed.\n", target_gc, target_gc);
 #else
        fprintf (stderr, "Error: --gc=<NAME> option not supported on this platform.\n");
 #endif
index abfa1ffe73b3cf93737bc63885693e13034587f3..ba9d6531367042081ba87410847ee375d5302d00 100644 (file)
@@ -100,11 +100,48 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type)
        }
 }
 
+/*
+ * Macros used to generate intermediate representation macros
+ *
+ * The macros use a `MonoConfig` object as its context, and among other
+ * things it is used to associate instructions with the memory pool with 
+ * it.
+ * 
+ * The macros come in three variations with slightly different
+ * features, the patter is: NEW_OP, EMIT_NEW_OP, MONO_EMIT_NEW_OP,
+ * the differences are as follows:
+ *
+ * `NEW_OP`: these are the basic macros to setup an instruction that is
+ * passed as an argument.
+ *
+ * `EMIT_NEW_OP`: these macros in addition to creating the instruction
+ * add the instruction to the current basic block in the `MonoConfig`
+ * object passed.   Usually these are used when further customization of
+ * the `inst` parameter is desired before the instruction is added to the
+ * MonoConfig current basic block.
+ *
+ * `MONO_EMIT_NEW_OP`: These variations of the instructions are used when
+ * you are merely interested in emitting the instruction into the `MonoConfig`
+ * parameter. 
+ */
 #undef MONO_INST_NEW
 /* 
  * FIXME: zeroing out some fields is not needed with the new IR, but the old 
  * JIT code still uses the left and right fields, so it has to stay.
  */
+
+/*
+ * MONO_INST_NEW: create a new MonoInst instance that is allocated on the MonoConfig pool.
+ *
+ * @cfg: the MonoConfig object that will be used as the context for the 
+ * instruction.
+ * @dest: this is the place where the instance of the `MonoInst` is stored.
+ * @op: the value that should be stored in the MonoInst.opcode field
+ *
+ * This initializes an empty MonoInst that has been nulled out, it is allocated
+ * from the memory pool associated with the MonoConfig, but it is not linked anywhere.
+ * the cil_code is set to the cfg->ip address. 
+ */
 #define MONO_INST_NEW(cfg,dest,op) do {        \
                (dest) = (MonoInst *)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoInst));    \
                (dest)->inst_c0 = (dest)->inst_c1 = 0; \
index 1b55991ff0290da9607e57336770694cab92c4db..95b0002ea9136a17b83300f6f8e8f173bc2418cf 100644 (file)
@@ -6125,8 +6125,13 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
                        return NULL;
        } else if (cmethod->klass == mono_defaults.monitor_class) {
                gboolean is_enter = FALSE;
+               gboolean is_v4 = FALSE;
 
-               if (!strcmp (cmethod->name, "Enter") && mono_method_signature (cmethod)->param_count == 1)
+               if (!strcmp (cmethod->name, "Enter") && fsig->param_count == 2 && fsig->params [1]->byref) {
+                       is_enter = TRUE;
+                       is_v4 = TRUE;
+               }
+               if (!strcmp (cmethod->name, "Enter") && fsig->param_count == 1)
                        is_enter = TRUE;
 
                if (is_enter) {
@@ -6138,10 +6143,10 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
 
                        NEW_BBLOCK (cfg, end_bb);
 
-                       ins = mono_emit_jit_icall (cfg, (gpointer)mono_monitor_enter_fast, args);
+                       ins = mono_emit_jit_icall (cfg, is_v4 ? (gpointer)mono_monitor_enter_v4_fast : (gpointer)mono_monitor_enter_fast, args);
                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ICOMPARE_IMM, -1, ins->dreg, 0);
                        MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_IBNE_UN, end_bb);
-                       ins = mono_emit_jit_icall (cfg, (gpointer)mono_monitor_enter, args);
+                       ins = mono_emit_jit_icall (cfg, is_v4 ? (gpointer)mono_monitor_enter_v4 : (gpointer)mono_monitor_enter, args);
                        MONO_START_BB (cfg, end_bb);
                        return ins;
                }
index aca368c9dba9e1ad8ef382fa8e7532a93981ffe5..736493198ed3b9556beb77bd842805959f7e862e 100644 (file)
@@ -3436,6 +3436,24 @@ mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gs
        MonoGenericContext *context = mono_method_get_context (method);
        MonoGenericInst *inst;
 
+       /*
+        * Instead of creating a shared version of the wrapper, create a shared version of the original
+        * method and construct a wrapper for it. Otherwise, we could end up with two copies of the
+        * same wrapper, breaking AOT which assumes wrappers are unique.
+        * FIXME: Add other cases.
+        */
+       if (method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
+               MonoMethod *wrapper = mono_marshal_method_from_wrapper (method);
+
+               return mono_marshal_get_synchronized_wrapper (mini_get_shared_method_full (wrapper, all_vt, is_gsharedvt));
+       }
+       if (method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
+               WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+               if (info->subtype == WRAPPER_SUBTYPE_NONE)
+                       return mono_marshal_get_delegate_invoke (mini_get_shared_method_full (info->d.delegate_invoke.method, all_vt, is_gsharedvt), NULL);
+       }
+
        if (method->is_generic || (method->klass->generic_container && !method->is_inflated)) {
                declaring_method = method;
        } else {
index 2ae3051b52074b80362733162ba2fcfa9fb5dc37..54873523202042720ff13d345b428e48f2bbab1e 100644 (file)
@@ -170,6 +170,7 @@ typedef struct {
        GPtrArray *bblock_list;
        char *method_name;
        GHashTable *jit_callees;
+       LLVMValueRef long_bb_break_var;
 } EmitContext;
 
 typedef struct {
@@ -4150,14 +4151,36 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                if (nins > 1000) {
                        /*
                         * Some steps in llc are non-linear in the size of basic blocks, see #5714.
-                        * Start a new bblock. If the llvm optimization passes merge these, we
-                        * can work around that by doing a volatile load + cond branch from
-                        * localloc-ed memory.
+                        * Start a new bblock.
+                        * Prevent the bblocks to be merged by doing a volatile load + cond branch
+                        * from localloc-ed memory.
                         */
                        if (!cfg->llvm_only)
-                               set_failure (ctx, "basic block too long");
+                               ;//set_failure (ctx, "basic block too long");
+
+                       if (!ctx->long_bb_break_var) {
+                               ctx->long_bb_break_var = build_alloca_llvm_type_name (ctx, LLVMInt32Type (), 0, "long_bb_break");
+                               mono_llvm_build_store (ctx->alloca_builder, LLVMConstInt (LLVMInt32Type (), 0, FALSE), ctx->long_bb_break_var, TRUE, LLVM_BARRIER_NONE);
+                       }
+
                        cbb = gen_bb (ctx, "CONT_LONG_BB");
-                       LLVMBuildBr (ctx->builder, cbb);
+                       LLVMBasicBlockRef dummy_bb = gen_bb (ctx, "CONT_LONG_BB_DUMMY");
+
+                       LLVMValueRef load = mono_llvm_build_load (builder, ctx->long_bb_break_var, "", TRUE);
+                       /*
+                        * The long_bb_break_var is initialized to 0 in the prolog, so this branch will always go to 'cbb'
+                        * but llvm doesn't know that, so the branch is not going to be eliminated.
+                        */
+                       LLVMValueRef cmp = LLVMBuildICmp (builder, LLVMIntEQ, load, LLVMConstInt (LLVMInt32Type (), 0, FALSE), "");
+
+                       LLVMBuildCondBr (builder, cmp, cbb, dummy_bb);
+
+                       /* Emit a dummy false bblock which does nothing but contains a volatile store so it cannot be eliminated */
+                       ctx->builder = builder = create_builder (ctx);
+                       LLVMPositionBuilderAtEnd (builder, dummy_bb);
+                       mono_llvm_build_store (builder, LLVMConstInt (LLVMInt32Type (), 1, FALSE), ctx->long_bb_break_var, TRUE, LLVM_BARRIER_NONE);
+                       LLVMBuildBr (builder, cbb);
+
                        ctx->builder = builder = create_builder (ctx);
                        LLVMPositionBuilderAtEnd (builder, cbb);
                        ctx->bblocks [bb->block_num].end_bblock = cbb;
index 6f6e266a3b025d72fd9998435b46a8b053747b31..b0d7a0709db70da65da166e78c821cdd66b50743 100644 (file)
@@ -140,11 +140,15 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid)
 static GHashTable *mono_saved_signal_handlers = NULL;
 
 static struct sigaction *
-get_saved_signal_handler (int signo)
+get_saved_signal_handler (int signo, gboolean remove)
 {
-       if (mono_saved_signal_handlers)
+       if (mono_saved_signal_handlers) {
                /* The hash is only modified during startup, so no need for locking */
-               return (struct sigaction *)g_hash_table_lookup (mono_saved_signal_handlers, GINT_TO_POINTER (signo));
+               struct sigaction *handler = g_hash_table_lookup (mono_saved_signal_handlers, GINT_TO_POINTER (signo));
+               if (remove && handler)
+                       g_hash_table_remove (mono_saved_signal_handlers, GINT_TO_POINTER (signo));
+               return handler;
+       }
        return NULL;
 }
 
@@ -167,21 +171,14 @@ save_old_signal_handler (int signo, struct sigaction *old_action)
        handler_to_save->sa_flags = old_action->sa_flags;
        
        if (!mono_saved_signal_handlers)
-               mono_saved_signal_handlers = g_hash_table_new (NULL, NULL);
+               mono_saved_signal_handlers = g_hash_table_new_full (NULL, NULL, NULL, g_free);
        g_hash_table_insert (mono_saved_signal_handlers, GINT_TO_POINTER (signo), handler_to_save);
 }
 
-static void
-free_saved_sig_handler_func (gpointer key, gpointer value, gpointer user_data)
-{
-       g_free (value);
-}
-
 static void
 free_saved_signal_handlers (void)
 {
        if (mono_saved_signal_handlers) {
-               g_hash_table_foreach (mono_saved_signal_handlers, free_saved_sig_handler_func, NULL);
                g_hash_table_destroy (mono_saved_signal_handlers);
                mono_saved_signal_handlers = NULL;
        }
@@ -198,7 +195,7 @@ gboolean
 MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal)
 {
        int signal = MONO_SIG_HANDLER_GET_SIGNO ();
-       struct sigaction *saved_handler = (struct sigaction *)get_saved_signal_handler (signal);
+       struct sigaction *saved_handler = (struct sigaction *)get_saved_signal_handler (signal, FALSE);
 
        if (saved_handler && saved_handler->sa_handler) {
                if (!(saved_handler->sa_flags & SA_SIGINFO)) {
@@ -453,7 +450,7 @@ static void
 remove_signal_handler (int signo)
 {
        struct sigaction sa;
-       struct sigaction *saved_action = get_saved_signal_handler (signo);
+       struct sigaction *saved_action = get_saved_signal_handler (signo, TRUE);
 
        if (!saved_action) {
                sa.sa_handler = SIG_DFL;
index a9c87011153b35ba64bf2d25f057801ea21ee03a..addb26bd446c5ad029797d2014b9ee49db71d602 100644 (file)
@@ -3744,6 +3744,8 @@ register_icalls (void)
                                ves_icall_get_trace);
        mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers",
                                mono_runtime_install_handlers);
+       mono_add_internal_call ("Mono.Runtime::mono_runtime_cleanup_handlers",
+                               mono_runtime_cleanup_handlers);
 
 #if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
        mono_add_internal_call ("System.Diagnostics.Debugger::Mono_UnhandledException_internal",
index 77775169fd7d0d5a615fdd69e4b2dd761566f948..122334e6ea6519613d4bd8e741fac583c13bafc7 100644 (file)
@@ -366,12 +366,9 @@ mini_add_method_trampoline (MonoMethod *m, gpointer compiled_method, gboolean ad
 
        if (callee_array_helper) {
                add_static_rgctx_tramp = FALSE;
-               /* FIXME: ji->from_aot is not set for llvm methods */
-               if (ji && (ji->from_aot || mono_aot_only)) {
-                       /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
-                       if (!mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
-                               add_static_rgctx_tramp = TRUE;
-               }
+               /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
+               if (ji && !mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
+                       add_static_rgctx_tramp = TRUE;
        }
 
        if (mono_llvm_only)
index ca30670b71ab4e712d39639fc1c7e6bd2e2ba307..84ea7d4549a9b72c2179c676fc5d1dccf9a63feb 100644 (file)
 #include "mono/sgen/sgen-memory-governor.h"
 #include "mono/sgen/sgen-client.h"
 
-/* keep each size a multiple of ALLOC_ALIGN */
+/*
+ * When allocating sgen memory we choose the allocator with the smallest slot size
+ * that can fit our requested size. These slots are allocated within a block that
+ * can contain at least 2 slots of the specific size.
+ *
+ * Currently, slots from 8 to 2044/2040 are allocated inside 4096 sized blocks,
+ * 2728 to 4092/4088 inside 8192 sized blocks, and higher inside 16384 sized
+ * blocks. We also need to make sure the slots are pointer size aligned so we
+ * don't allocate unaligned memory.
+ *
+ * The computation of these sizes spawns from two basic rules :
+ *     - if we use slots of size s1 that fit n times in a block, it is illogical
+ * to use another slot of size s2 which also fits the same n times in a block.
+ *     - if we use slots of size s1 that fit n times in a block, there is no
+ * s2 > s1 that can fit n times in the block. That would mean we are wasting memory
+ * when allocating size S where s1 < S <= s2.
+ */
 #if SIZEOF_VOID_P == 4
 static const int allocator_sizes [] = {
           8,   16,   24,   32,   40,   48,   64,   80,
-         96,  128,  160,  192,  224,  248,  296,  320,
-        384,  448,  504,  528,  584,  680,  816, 1088,
-       1360, 2046, 2336, 2728, 3272, 4094, 5456, 8190 };
+         96,  124,  160,  192,  224,  252,  292,  340,
+        408,  452,  508,  584,  680,  816, 1020,
+       1364, 2044, 2728, 4092, 5460, 8188 };
 #else
 static const int allocator_sizes [] = {
           8,   16,   24,   32,   40,   48,   64,   80,
-         96,  128,  160,  192,  224,  248,  296,  320,
-        384,  448,  504,  528,  584,  680,  816, 1088,
-       1360, 2044, 2336, 2728, 3272, 4092, 5456, 8188 };
+         96,  128,  160,  192,  224,  248,  288,  336,
+        368,  448,  504,  584,  680,  816, 1016,
+       1360, 2040, 2728, 4088, 5456, 8184 };
 #endif
 
 #define NUM_ALLOCATORS (sizeof (allocator_sizes) / sizeof (int))
@@ -173,6 +189,8 @@ sgen_alloc_internal_dynamic (size_t size, int type, gboolean assert_on_failure)
                        sgen_assert_memory_alloc (NULL, size, description_for_type (type));
                memset (p, 0, size);
        }
+
+       SGEN_ASSERT (0, !(((mword)p) & (sizeof(gpointer) - 1)), "Why do we allocate unaligned addresses ?");
        return p;
 }
 
@@ -206,6 +224,8 @@ sgen_alloc_internal (int type)
        p = mono_lock_free_alloc (&allocators [index]);
        memset (p, 0, size);
 
+       SGEN_ASSERT (0, !(((mword)p) & (sizeof(gpointer) - 1)), "Why do we allocate unaligned addresses ?");
+
        return p;
 }
 
@@ -264,10 +284,11 @@ sgen_init_internal_allocator (void)
        }
 
        for (size = mono_pagesize (); size <= LOCK_FREE_ALLOC_SB_MAX_SIZE; size <<= 1) {
-               int max_size = LOCK_FREE_ALLOC_SB_USABLE_SIZE (size) / 2;
+               int max_size = (LOCK_FREE_ALLOC_SB_USABLE_SIZE (size) / 2) & ~(SIZEOF_VOID_P - 1);
                /*
                 * we assert that allocator_sizes contains the biggest possible object size
-                * per block (4K => 4080 / 2 = 2040, 8k => 8176 / 2 = 4088, 16k => 16368 / 2 = 8184 on 64bits),
+                * per block which has to be an aligned address.
+                * (4K => 2040, 8k => 4088, 16k => 8184 on 64bits),
                 * so that we do not get different block sizes for sizes that should go to the same one
                 */
                g_assert (allocator_sizes [index_for_size (max_size)] == max_size);
index 3c96a2f0106bfc78cf20bca223315e7bd3f8c63a..d6460111a0f4094c25b90ca38e8f2445e0d6edd8 100644 (file)
@@ -142,7 +142,8 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
 
                SGEN_ASSERT (9, !SGEN_VTABLE_IS_PINNED (vtable_word), "Pinned object in non-pinned block?");
 
-               desc = sgen_vtable_get_descriptor ((GCVTable)vtable_word);
+               /* We untag the vtable for concurrent M&S, in case bridge is running and it tagged it */
+               desc = sgen_vtable_get_descriptor ((GCVTable)SGEN_POINTER_UNTAG_VTABLE (vtable_word));
                type = desc & DESC_TYPE_MASK;
 
                if (sgen_safe_object_is_small (obj, type)) {
@@ -183,7 +184,7 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
 
                        sgen_los_pin_object (obj);
                        if (SGEN_OBJECT_HAS_REFERENCES (obj))
-                               GRAY_OBJECT_ENQUEUE (queue, obj, sgen_obj_get_descriptor (obj));
+                               GRAY_OBJECT_ENQUEUE (queue, obj, desc);
                }
                return FALSE;
        }
index d67b9ff1fed2bb89a6a5697356203fd73b123b95..3e29ab15df46efe42c1bb846bc2a57b0ef1345f8 100644 (file)
@@ -30,6 +30,8 @@ monoutils_sources = \
        mono-log-windows.c      \
        mono-log-common.c       \
        mono-log-posix.c        \
+       mono-log-android.c \
+       mono-log-darwin.c \
        mono-internal-hash.c    \
        mono-internal-hash.h    \
        mono-io-portability.c   \
diff --git a/mono/utils/mono-log-android.c b/mono/utils/mono-log-android.c
new file mode 100644 (file)
index 0000000..fde2fd0
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * mono-log-android.c: Android-specific interface to the logger
+ *
+ * This module contains the Android logcat logger interface
+ *
+ * Author:
+ *    Marek Habersack <grendel@twistedcode.net>
+ *
+ */
+#include <config.h>
+
+#if defined (PLATFORM_ANDROID)
+
+#include <android/log.h>
+#include "mono-logger-internals.h"
+
+/**
+ * mono_log_open_logcat
+ *
+ *     Open access to Android logcat (no-op)
+ *
+ *     @path - Not used
+ *     @userData - Not used
+ */   
+void
+mono_log_open_logcat (const char *path, void *userData)
+{
+       /* No-op on Android */
+}
+
+/**
+ * mono_log_write_logcat
+ *
+ *     Write data to Android logcat.
+ *
+ *     @domain - Identifier string
+ *     @level - Logging level flags
+ *     @format - Printf format string
+ *     @vargs - Variable argument list
+ */
+void
+mono_log_write_logcat (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message)
+{
+       android_LogPriority apriority;
+
+       switch (level & G_LOG_LEVEL_MASK)
+       {
+               case G_LOG_LEVEL_ERROR:
+                       apriority = ANDROID_LOG_FATAL;
+                       break;
+
+               case G_LOG_LEVEL_CRITICAL:
+                       apriority = ANDROID_LOG_ERROR;
+                       break;
+
+               case G_LOG_LEVEL_WARNING:
+                       apriority = ANDROID_LOG_WARN;
+                       break;
+
+               case G_LOG_LEVEL_MESSAGE:
+                       apriority = ANDROID_LOG_INFO;
+                       break;
+
+               case G_LOG_LEVEL_INFO:
+                       apriority = ANDROID_LOG_DEBUG;
+                       break;
+
+               case G_LOG_LEVEL_DEBUG:
+                       apriority = ANDROID_LOG_VERBOSE;
+                       break;
+
+               default:
+                       apriority = ANDROID_LOG_UNKNOWN;
+                       break;
+       }
+
+       __android_log_write (apriority, log_domain, message);
+       if (apriority == ANDROID_LOG_FATAL)
+               abort ();
+}
+
+/**
+ * mono_log_close_logcat
+ *
+ *     Close access to Android logcat (no-op)
+ */
+void
+mono_log_close_logcat ()
+{
+       /* No-op on Android */
+}
+#endif
diff --git a/mono/utils/mono-log-darwin.c b/mono/utils/mono-log-darwin.c
new file mode 100644 (file)
index 0000000..1214291
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * mono-log-darwin.c: Darwin-specific interface to the logger
+ *
+ */
+#include <config.h>
+
+#if defined(HOST_IOS)
+
+#include <asl.h>
+#include "mono-logger-internals.h"
+static int
+to_asl_priority (GLogLevelFlags log_level)
+{
+       switch (log_level & G_LOG_LEVEL_MASK)
+       {
+               case G_LOG_LEVEL_ERROR:     return ASL_LEVEL_CRIT;
+               case G_LOG_LEVEL_CRITICAL:  return ASL_LEVEL_ERR;
+               case G_LOG_LEVEL_WARNING:   return ASL_LEVEL_WARNING;
+               case G_LOG_LEVEL_MESSAGE:   return ASL_LEVEL_NOTICE;
+               case G_LOG_LEVEL_INFO:      return ASL_LEVEL_INFO;
+               case G_LOG_LEVEL_DEBUG:     return ASL_LEVEL_DEBUG;
+       }
+       return ASL_LEVEL_ERR;
+}
+
+void
+mono_log_open_asl (const char *path, void *userData)
+{
+}
+
+void
+mono_log_write_asl (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message)
+{
+       asl_log (NULL, NULL, to_asl_priority (level), "%s%s%s\n",
+               log_domain != NULL ? log_domain : "",
+               log_domain != NULL ? ": " : "",
+               message);
+
+       if (level & G_LOG_LEVEL_ERROR)
+               abort();
+}
+
+void
+mono_log_close_asl ()
+{
+}
+#endif
index 57ef259677fd4b3ec81df0cadc1f70e6da914eb0..b10ad2236ae86988690847952b78e67a7091fae0 100644 (file)
@@ -175,6 +175,19 @@ void mono_log_open_logfile (const char *, void *);
 void mono_log_write_logfile (const char *, GLogLevelFlags, mono_bool, const char *);
 void mono_log_close_logfile (void);
 
+#if PLATFORM_ANDROID
+void mono_log_open_logcat (const char *path, void *userData);
+void mono_log_write_logcat (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message);
+void mono_log_close_logcat (void);
+#endif
+
+#if defined(HOST_IOS)
+void mono_log_open_asl (const char *path, void *userData);
+void mono_log_write_asl (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message);
+void mono_log_close_asl (void);
+
+#endif
+
 G_END_DECLS
 
 #endif /* __MONO_LOGGER_INTERNAL_H__ */
index 20457c95b677c91eedb261eace27b409229db62d..b4367a73367dc03ff57c2a4d76cbc6fab9d9b553 100644 (file)
@@ -148,19 +148,30 @@ mono_trace_set_logdest_string (const char *dest)
        if(level_stack == NULL)
                mono_trace_init();
 
+#if PLATFORM_ANDROID
+       logger.opener = mono_log_open_logcat;
+       logger.writer = mono_log_write_logcat;
+       logger.closer = mono_log_close_logcat;
+       logger.dest   = (char*) dest;
+#elif defined (HOST_IOS)
+       logger.opener = mono_log_open_asl;
+       logger.writer = mono_log_write_asl;
+       logger.closer = mono_log_close_asl;
+       logger.dest   = (char*) dest;
+#else
        if ((dest == NULL) || (strcmp("syslog", dest) != 0)) {
                logger.opener = mono_log_open_logfile;
                logger.writer = mono_log_write_logfile;
                logger.closer = mono_log_close_logfile;
                logger.dest   = (char *) dest;
-               mono_trace_set_log_handler_internal(&logger, NULL);
        } else {
                logger.opener = mono_log_open_syslog;
                logger.writer = mono_log_write_syslog;
                logger.closer = mono_log_close_syslog;
                logger.dest   = (char *) dest;
-               mono_trace_set_log_handler_internal(&logger, NULL);
        }
+#endif
+       mono_trace_set_log_handler_internal(&logger, NULL);
 }
 
 /**
index a8a5b53274e95a0041f8ca6cbed2510df8229c40..9e6ebe712c2c446ba607190f6d4fb8d14c477c62 100644 (file)
@@ -157,7 +157,11 @@ mono_threads_platform_exit (int exit_code)
 void
 mono_threads_platform_unregister (MonoThreadInfo *info)
 {
-       mono_threads_platform_set_exited (info);
+       g_assert (info->handle);
+
+       /* The thread is no longer active, so unref it */
+       mono_w32handle_unref (info->handle);
+       info->handle = NULL;
 }
 
 int
@@ -285,28 +289,23 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
 }
 
 void
-mono_threads_platform_set_exited (MonoThreadInfo *info)
+mono_threads_platform_set_exited (gpointer handle)
 {
        int thr_ret;
 
-       g_assert (info->handle);
-       if (mono_w32handle_issignalled (info->handle))
-               g_error ("%s: handle %p thread %p has already exited, it's handle is signalled", __func__, info->handle, mono_thread_info_get_tid (info));
-       if (mono_w32handle_get_type (info->handle) == MONO_W32HANDLE_UNUSED)
-               g_error ("%s: handle %p thread %p has already exited, it's handle type is 'unused'", __func__, info->handle, mono_thread_info_get_tid (info));
+       g_assert (handle);
+       if (mono_w32handle_issignalled (handle))
+               g_error ("%s: handle %p thread %p has already exited, it's handle is signalled", __func__, handle, mono_native_thread_id_get ());
+       if (mono_w32handle_get_type (handle) == MONO_W32HANDLE_UNUSED)
+               g_error ("%s: handle %p thread %p has already exited, it's handle type is 'unused'", __func__, handle, mono_native_thread_id_get ());
 
-       thr_ret = mono_w32handle_lock_handle (info->handle);
+       thr_ret = mono_w32handle_lock_handle (handle);
        g_assert (thr_ret == 0);
 
-       mono_w32handle_set_signal_state (info->handle, TRUE, TRUE);
+       mono_w32handle_set_signal_state (handle, TRUE, TRUE);
 
-       thr_ret = mono_w32handle_unlock_handle (info->handle);
+       thr_ret = mono_w32handle_unlock_handle (handle);
        g_assert (thr_ret == 0);
-
-       /* The thread is no longer active, so unref it */
-       mono_w32handle_unref (info->handle);
-
-       info->handle = NULL;
 }
 
 static const gchar* thread_typename (void)
index e2b489ecc1064f6eea5fc9c1bd76818232ef1941..7beb557fc70ef3661f0c5b7e0ed7705dd97708b1 100644 (file)
@@ -243,7 +243,10 @@ mono_threads_platform_exit (int exit_code)
 void
 mono_threads_platform_unregister (MonoThreadInfo *info)
 {
-       mono_threads_platform_set_exited (info);
+       g_assert (info->handle);
+
+       CloseHandle (info->handle);
+       info->handle = NULL;
 }
 
 int
@@ -309,12 +312,8 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
 }
 
 void
-mono_threads_platform_set_exited (MonoThreadInfo *info)
+mono_threads_platform_set_exited (gpointer handle)
 {
-       g_assert (info->handle);
-       // No need to call CloseHandle() here since the InternalThread
-       // destructor will close the handle when the finalizer thread calls it
-       info->handle = NULL;
 }
 
 void
index 3eb88171257a0f68687870c9655144791ae779d9..f8c716b5038d941b9a74edbf0f0ab84e52be9450 100644 (file)
@@ -399,6 +399,7 @@ unregister_thread (void *arg)
        MonoThreadInfo *info;
        int small_id;
        gboolean result;
+       gpointer handle;
 
        info = (MonoThreadInfo *) arg;
        g_assert (info);
@@ -423,6 +424,10 @@ unregister_thread (void *arg)
        mono_native_tls_set_value (small_id_key, GUINT_TO_POINTER (info->small_id + 1));
 #endif
 
+       /* we need to duplicate it, as the info->handle is going
+        * to be closed when unregistering from the platform */
+       handle = mono_threads_platform_duplicate_handle (info);
+
        /*
        First perform the callback that requires no locks.
        This callback has the potential of taking other locks, so we do it before.
@@ -457,6 +462,13 @@ unregister_thread (void *arg)
        mono_thread_hazardous_try_free_some ();
 
        mono_thread_small_id_free (small_id);
+
+       /* Signal the w32handle. It can be done as late as here
+        * because w32handle does not access the current MonoThreadInfo,
+        * neither does it switch state to BLOCKING. */
+       mono_threads_platform_set_exited (handle);
+
+       mono_threads_platform_close_thread_handle (handle);
 }
 
 static void
@@ -1638,7 +1650,9 @@ void
 mono_thread_info_set_exited (THREAD_INFO_TYPE *info)
 {
        g_assert (mono_thread_info_is_current (info));
-       mono_threads_platform_set_exited (info);
+
+       g_assert (info->handle);
+       mono_threads_platform_set_exited (info->handle);
 }
 
 gpointer
index db4bdab73b73dee37082ed8fbdf610a64c4902b7..5e31607c176eb466536b4a38db672d4efcd54e0d 100644 (file)
@@ -522,7 +522,7 @@ gboolean mono_threads_platform_yield (void);
 void mono_threads_platform_exit (int exit_code);
 HANDLE mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
 void mono_threads_platform_close_thread_handle (HANDLE handle);
-void mono_threads_platform_set_exited (THREAD_INFO_TYPE *info);
+void mono_threads_platform_set_exited (gpointer handle);
 gpointer mono_threads_platform_duplicate_handle (THREAD_INFO_TYPE *info);
 
 void mono_threads_coop_begin_global_suspend (void);