Build eglib under none desktop Windows API family.
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
[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
============================
+++ /dev/null
-#
-# 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
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;
include $(topdir)/build/profiles/monotouch.make
PROFILE_MCS_FLAGS += \
+ -d:FEATURE_NO_BSD_SOCKETS \
-d:MONOTOUCH_WATCH
NO_THREAD_ABORT=1
include $(topdir)/build/profiles/monotouch_runtime.make
PROFILE_MCS_FLAGS += \
+ -d:FEATURE_NO_BSD_SOCKETS \
-d:MONOTOUCH_WATCH
NO_THREAD_ABORT=1
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)
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
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 \
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:
{
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]
/*
* 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);
}
}
}
/// <summary>
/// RFC 2246 A.5
/// </summary>
+ [CLSCompliant (false)]
public enum CipherSuiteCode : ushort
{
TLS_NULL_WITH_NULL_NULL = 0x0000,
{
public class MonoTlsConnectionInfo
{
+ [CLSCompliant (false)]
public CipherSuiteCode CipherSuiteCode {
get; set;
}
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.
*/
}
/*
- * 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);
}
/*
{
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
}
}
get; set;
}
+ [CLSCompliant (false)]
public CipherSuiteCode[] EnabledCiphers {
get; set;
}
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
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)
{
}
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
return new MemoryMappedFile () {
handle = handle,
- fileAccess = MemoryMappedFileAccess.ReadWrite,
- fileCapacity = capacity
+ // fileAccess = MemoryMappedFileAccess.ReadWrite,
+ // fileCapacity = capacity
};
}
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity
};
}
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
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
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity
};
}
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);
};
}
// 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;
}
--- /dev/null
+//
+// 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
+ }
+}
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Properties_Defaults ()
{
var h = new HttpClientHandler ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Properties_Invalid ()
{
var h = new HttpClientHandler ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Properties_AfterClientCreation ()
{
var h = new HttpClientHandler ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Disposed ()
{
var h = new HttpClientHandler ();
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ // Using HttpClientHandler, which indirectly requires BSD sockets.
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CancelRequestViaProxy ()
{
var handler = new HttpClientHandler {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Proxy_Disabled ()
{
var pp = WebRequest.DefaultWebProxy;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Default ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Version_1_0 ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_ClientHandlerSettings ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_CustomHeaders ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_CustomHeaders_SpecialSeparators ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_CustomHeaders_Host ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Transfer_Encoding_Chunked ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Transfer_Encoding_Custom ()
{
bool? failed = null;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Content ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Content_MaxResponseContentBufferSize ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Content_MaxResponseContentBufferSize_Error ()
{
var listener = CreateListener (l => {
}
[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 }) {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Complete_Error ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Content_Get ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Content_BomEncoding ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Content_Put ()
{
bool passed = false;
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Content_Put_CustomStream ()
{
bool passed = false;
[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) => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetByteArray_ServerError ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DisallowAutoRedirect ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void RequestUriAfterRedirect ()
{
var listener = CreateListener (l => {
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
/*
* Properties may only be modified before sending the first request.
*/
}
[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
--- /dev/null
+System.Net.Http/HttpClientHandler.cs
--- /dev/null
+#include System.Net.Http.dll.sources
+System.Net.Http/HttpClientHandler.platformnotsupported.cs
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;
--- /dev/null
+//
+// 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 (); }
+ }
+}
+
#include ReferenceSource.common.sources
ReferenceSources/SchemaExporter_mobile.cs
+ReferenceSources/XsdDataContractExporter_mobile.cs
ReferenceSources/SimplifiedCodeTypeReference.cs
static bool AreEqual (VisualStyleElement value1, VisualStyleElement value2)
{
return
- value1.ClassName == value1.ClassName &&
+ value1.ClassName == value2.ClassName &&
value1.Part == value2.Part &&
value1.State == value2.State;
}
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++;
{
}
+ 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)
{
}
}
+ 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);
using System.Collections;
using System.IO;
using System.Text;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Policy;
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);
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
}
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 ();
}
Complete,
WantRead,
WantWrite,
- ReadDone
+ ReadDone,
+ FinishWrite
}
class AsyncProtocolRequest
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)
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) {
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");
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 ();
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);
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
/*
settings = MonoTlsSettings.CopyDefaultSettings ();
if (cloneSettings)
settings = settings.CloneWithValidator (this);
+ if (provider == null)
+ provider = MonoTlsProviderFactory.GetProvider ();
this.provider = provider;
this.settings = settings;
: base (innerStream, leaveInnerStreamOpen)
{
this.provider = provider;
- certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
+ certificateValidator = ChainValidationHelper.GetInternalValidator (provider, settings);
}
#endregion // Constructors
if (wantMore || writeBuffer.Size > 0)
return AsyncOperationStatus.WantWrite;
+ asyncRequest.ResetWrite ();
asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete;
}
this.clientCertificates = clientCertificates;
this.askForClientCert = askForClientCert;
- certificateValidator = CertificateValidationHelper.GetDefaultValidator (
+ certificateValidator = CertificateValidationHelper.GetInternalValidator (
parent.Settings, parent.Provider);
}
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
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)
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)
//
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
#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
}
}
+ internal static TraceSource Sockets {
+ get {
+ return null;
+ }
+ }
+
[Conditional ("TRACE")]
internal static void Enter(TraceSource traceSource, object obj, string method, object paramObject) {
}
// 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)
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 ());
int error;
- SetSocketOption_internal (safe_handle, optionLevel, optionName, null,
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, null,
null, optionValue, out error);
if (!silent && error != 0)
+++ /dev/null
-//
-// 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);
- }
- }
-}
+++ /dev/null
-//
-// 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);
- }
- }
-}
// 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 (); }
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 (); }
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
set { bodyEncoding = value; }
}
+ public TransferEncoding BodyTransferEncoding {
+ get { return GuessTransferEncoding (BodyEncoding); }
+ set { throw new NotImplementedException (); }
+ }
+
public MailAddressCollection CC {
get { return cc; }
}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
+
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));
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)
{
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)
{
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)
{
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)
{
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)
{
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
*/
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;
/* 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 ()
}
}
- //
- // 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);
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;
}
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);
[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;
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 ();
* "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:
* "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;
}
}
- 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 {
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);
[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);
internal set { is_connected = value; }
}
- public ProtocolType ProtocolType {
- get { return protocol_type; }
- }
-
+ // FIXME: import from referencesource
public bool NoDelay {
get {
ThrowIfDisposedAndClosed ();
}
}
- 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 ();
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);
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);
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)
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)
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;
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;
}
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;
}
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 ();
AcceptSocket = acceptSocket,
};
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
return sockares;
}
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;
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 ();
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)
}
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);
is_bound = true;
seed_endpoint = localEP;
+#endif // FEATURE_NO_BSD_SOCKETS
}
private static void Bind_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
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);
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;
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);
}
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
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;
}
}
});
- 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");
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,
// 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);
}
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;
ThrowIfDisposedAndClosed ();
int error = 0;
- Disconnect_internal (safe_handle, reuseSocket, out error);
+ Disconnect_internal (m_Handle, reuseSocket, out error);
if (error != 0) {
if (error == 50) {
#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)
{
}
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)
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);
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;
}
});
- 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;
});
[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;
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 {
#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)
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;
}
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;
}
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;
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)
{
#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)]
}
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) {
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)
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);
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;
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;
}
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;
sockares.Offset += total;
sockares.Size -= total;
- if (sockares.socket.is_disposed) {
+ if (sockares.socket.CleanedUp) {
sockares.Complete (total);
return;
}
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;
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 ();
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;
#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 ();
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)
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;
}
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;
}
{
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;
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 {
#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 ();
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 ();
}
}
- 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 ();
#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)
{
(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
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);
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);
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);
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)
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");
}
{
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)
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);
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;
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);
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)
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 ());
}
void ThrowIfUdp ()
{
- if (protocol_type == ProtocolType.Udp)
+ if (protocolType == ProtocolType.Udp)
throw new SocketException ((int)SocketError.ProtocolOption);
}
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)
set;
}
-#if !MOBILE
public TransmitFileOptions SendPacketsFlags {
get;
set;
}
-#endif
[MonoTODO ("unused property")]
public int SendPacketsSendSize {
public void Complete ()
{
- if (operation != SocketOperation.Receive && socket.is_disposed)
+ if (operation != SocketOperation.Receive && socket.CleanedUp)
DelayedException = new ObjectDisposedException (socket.GetType ().ToString ());
IsCompleted = true;
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
}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
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>
--- /dev/null
+//
+// 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);
+ }
+ }
+}
socket.Bind (localEP);
}
+ public void AllowNatTraversal (bool allowed)
+ {
+ if (allowed)
+ socket.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
+ else
+ socket.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
+ }
+
public void Close ()
{
Dispose ();
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
}
}
+ [MonoTODO]
+ internal static bool OSSupportsExtendedProtection {
+ get {
+ return false;
+ }
+ }
+
internal static void Clear ()
{
EnsureModules ();
[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");
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");
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)
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")
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");
GetHostEntryIPCallback c = new GetHostEntryIPCallback (GetHostEntry);
return c.BeginInvoke (address, requestCallback, stateObject);
+#endif // FEATURE_NO_BSD_SOCKETS
}
[Obsolete ("Use EndGetHostEntry instead")]
[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;
[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");
ret = GetHostByName(hostName);
return ret;
+#endif // FEATURE_NO_BSD_SOCKETS
}
public static Task<IPAddress[]> GetHostAddressesAsync (string hostNameOrAddress)
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
+using System.Security.Authentication.ExtendedProtection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
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);
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)
}
}
+ 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 {
}
}
+ [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; }
--- /dev/null
+//
+// 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);
+ }
+ }
+}
}
}
+ [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 ();
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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);
+ }
+ }
+}
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
--- /dev/null
+//
+// 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);
+ }
+ }
+}
--- /dev/null
+//
+// 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 "";
+ }
+ }
+}
{
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
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; }
}
return EndGetRequestStream (asyncResult);
}
+ [MonoTODO]
+ public Stream GetRequestStream (out TransportContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
bool CheckIfForceWrite (SimpleAsyncResult result)
{
if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
--- /dev/null
+//
+// 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); }
+ }
+ }
+}
version = (Version) info.GetValue ("version", typeof (Version));
statusCode = (HttpStatusCode) info.GetValue ("statusCode", typeof (HttpStatusCode));
}
-
+
// Properties
public string CharacterSet {
--- /dev/null
+//
+// 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);
+ }
+ }
+}
}
}
+ [MonoTODO]
+ public static bool ReusePort {
+ get { return false; }
+ set { throw new NotImplementedException (); }
+ }
+
public static SecurityProtocolType SecurityProtocol {
get { return _securityProtocol; }
set { _securityProtocol = value; }
}
}
+ [MonoTODO ("Always returns EncryptionPolicy.RequireEncryption.")]
+ public static EncryptionPolicy EncryptionPolicy {
+ get {
+ return EncryptionPolicy.RequireEncryption;
+ }
+ }
+
public static bool Expect100Continue {
get { return expectContinue; }
set { expectContinue = value; }
+++ /dev/null
-//
-// 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 ();
- }
- }
-}
-
using System.IO;
using System.Text;
using System.Collections;
+using System.Runtime.Serialization;
namespace System.Security.Cryptography.X509Certificates {
{
}
+ protected X509Certificate2 (SerializationInfo info, StreamingContext context) : base (info, context)
+ {
+ }
+
internal X509Certificate2 (X509Certificate2Impl impl)
: base (impl)
{
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
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
../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
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
../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
../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
../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
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);
}
[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");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void EnableSsl ()
{
Assert.IsFalse (smtp.EnableSsl, "#1");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Host ()
{
smtp.Host = "127.0.0.1";
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Host_Value_Null ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Host_Value_Empty ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PickupDirectoryLocation ()
{
Assert.IsNull (smtp.PickupDirectoryLocation, "#1");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Port ()
{
Assert.AreEqual (25, smtp.Port, "#1");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Port_Value_Invalid ()
{
// zero
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Message_Null ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Network_Host_Null ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_Network_Host_Whitespace ()
{
smtp.Host = " \r\n ";
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory ()
{
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_DirectoryNotFound ()
{
Directory.Delete (tempFolder);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Empty ()
{
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_IllegalChars ()
{
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_NotAbsolute ()
{
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Null ()
{
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Timeout ()
{
Assert.AreEqual (100000, smtp.Timeout, "#1");
}
[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 ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Deliver_Envelope ()
{
var server = new SmtpServer ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Deliver_Async ()
{
// SmtpClient uses BackgroundWorker and listens for the RunWorkerCompleted
{
[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 };
}
[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);
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);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadTimeout ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
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);
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);
namespace MonoTests.System.Net.Sockets
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class SocketAsyncTest
{
Socket serverSocket;
ManualResetEvent mainEvent;
Exception error;
- [TestFixtureSetUp]
- public void SetUp ()
+ void SetUp ()
{
readyEvent = new ManualResetEvent (false);
mainEvent = new ManualResetEvent (false);
ThreadPool.QueueUserWorkItem (_ => DoWork ());
readyEvent.WaitOne ();
+ if (error != null)
+ throw error;
+
clientSocket = new Socket (
AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
clientSocket.Connect (serverSocket.LocalEndPoint);
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)
[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 ();
namespace MonoTests.System.Net.Sockets
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class SocketTest
{
// note: also used in SocketCas tests
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 ());
[Test]
[Category ("InetAccess")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BogusEndConnect ()
{
IPAddress ipOne = IPAddress.Parse (BogusAddress);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AcceptBlockingStatus()
{
bool block;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectFailAsync ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SetSocketOptionBoolean ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, NetworkHelpers.FindFreePort ());
}
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestSelect1 ()
{
Socket srv = CreateServer (NetworkHelpers.FindFreePort ());
}
[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);
}
[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);
}
[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);
}
[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);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetHashCodeTest ()
{
Socket server = new Socket (AddressFamily.InterNetwork,
}
[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,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void IsBoundTcp ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void IsBoundUdp ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof(InvalidOperationException))]
+#endif
public void BeginAcceptNotListening ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAccept ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAcceptData ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAcceptSocketUdp ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAcceptSocketBound ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAcceptSocket ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginAcceptSocketAccClosed ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectAddressPort ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectAddressPortListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectMultiple2 ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectMultipleListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectHostPortListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
[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,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BindTwice ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Close ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectAddressPort ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectAddressPortListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectMultiple2 ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectMultipleListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectHostPortListen ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof(ObjectDisposedException))]
+#endif
public void ConnectHostPortClosed ()
{
Socket sock = new Socket (AddressFamily.InterNetwork,
[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,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveGeneric ()
{
int i;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SendGeneric ()
{
int i;
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],
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseWhileReceiving ()
{
CWRSocket = new Socket (AddressFamily.InterNetwork,
}
[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,
}
[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,
}
[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,
}
[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,
}
[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,
}
[Test] // ReceiveFrom (Byte [], Int32, SocketFlags, ref EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveFrom3_Size_OutOfRange ()
{
Socket s;
}
[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,
}
[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,
}
[Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveFrom4_Offset_OutOfRange ()
{
Socket s;
}
[Test] // ReceiveFrom (Byte [], Int32, Int32, SocketFlags, EndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveFrom4_Size_OutOfRange ()
{
Socket s;
}
[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,
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveRemoteClosed ()
{
var port = NetworkHelpers.FindFreePort ();
//
// 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,
// 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,
}
[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");
}
[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");
}
[Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SetSocketOption3_AddMembershipIPv6_IPv6MulticastOption ()
{
if (!Socket.OSSupportsIPv6)
}
[Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SetSocketOption3_AddMembershipIPv6_MulticastOption ()
{
if (!Socket.OSSupportsIPv6)
}
[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");
}
[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");
}
[Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SetSocketOption3_DropMembershipIPv6_IPv6MulticastOption ()
{
if (!Socket.OSSupportsIPv6)
}
[Test] // SetSocketOption (SocketOptionLevel, SocketOptionName, Object)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SetSocketOption3_DropMembershipIPv6_MulticastOption ()
{
if (!Socket.OSSupportsIPv6)
}
[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");
}
[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");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Shutdown_NoConnect ()
{
Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SendAsyncFile ()
{
Socket serverSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectToIPV4EndPointUsingDualModelSocket () {
/*
* IPv6 DualMode sockets are defaults in Mono. Explicitly specify that
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginConnectToIPV4EndPointUsingDualModelSocket () {
/*
* IPv6 DualMode sockets are defaults in Mono. Explicitly specify that
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UdpMulticasTimeToLive ()
{
/* see https://bugzilla.xamarin.com/show_bug.cgi?id=36941 */
/// Tests System.Net.Sockets.TcpClient
/// </summary>
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class TcpClientTest
{
/// (from System.Net.Sockets)
/// </summary>
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TcpClient()
{
// set up a listening Socket
}
[Test] // bug #81105
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseTest ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof(ArgumentNullException))]
+#endif
public void ConnectMultiNull ()
{
TcpClient client = new TcpClient ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectMultiAny ()
{
TcpClient client = new TcpClient ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectMultiRefused ()
{
TcpClient client = new TcpClient ();
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 ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CtorInt1 ()
{
int nex = 0;
}
[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);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PreStartStatus ()
{
MyListener listener = new MyListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PostStartStatus ()
{
MyListener listener = new MyListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StartListenMoreThan5 ()
{
var port = NetworkHelpers.FindFreePort ();
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;
}
[Test] // .ctor (AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor2 ()
{
MyUdpClient client;
}
[Test] // .ctor (AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor2_Family_Invalid ()
{
try {
}
[Test] // .ctor (Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor3 ()
{
Socket s;
}
[Test] // .ctor (Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor3_Port_OutOfRange ()
{
try {
}
[Test] // .ctor (IPEndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor4 ()
{
Socket s;
}
[Test] // .ctor (IPEndPoint)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor4_LocalEP_Null ()
{
try {
}
[Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor5 ()
{
Socket s;
}
[Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor5_Family_Invalid ()
{
try {
}
[Test] // .ctor (Int32, AddressFamily)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor5_Port_OutOfRange ()
{
try {
}
[Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor6 ()
{
Socket s;
}
[Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor6_HostName_Null ()
{
try {
}
[Test] // .ctor (String, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Constructor6_Port_OutOfRange ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UdpClientBroadcastTest ()
{
UdpClient client = new UdpClient ();
}
[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");
}
[Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup1_IPv6 ()
{
if (!Socket.OSSupportsIPv6)
}
[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))) {
}
[Test] // JoinMulticastGroup (IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup1_Socket_Closed ()
{
IPAddress mcast_addr = null;
}
[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");
}
[Test] // JoinMulticastGroup (In32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup2_IPv6 ()
{
if (!Socket.OSSupportsIPv6)
}
[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))) {
}
[Test] // JoinMulticastGroup (Int32, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup2_Socket_Closed ()
{
if (!Socket.OSSupportsIPv6)
}
[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");
}
[Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup3_IPv6 ()
{
if (!Socket.OSSupportsIPv6)
}
[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))) {
}
[Test] // JoinMulticastGroup (IPAddress, Int32)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup3_Socket_Closed ()
{
IPAddress mcast_addr = null;
}
[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");
}
[Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup4_IPv6 ()
{
if (!Socket.OSSupportsIPv6)
}
[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");
}
[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))) {
}
[Test] // JoinMulticastGroup (IPAddress, IPAddress)
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroup4_Socket_Closed ()
{
IPAddress mcast_addr = null;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseInReceive ()
{
UdpClient client = null;
// Test for bug 324033
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void JoinMulticastGroupWithLocal ()
{
UdpClient client = new UdpClient (9001);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof(ArgumentNullException))]
+#endif
public void BeginSendNull ()
{
UdpClient client = new UdpClient ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginSend ()
{
UdpClient client = new UdpClient ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginReceive ()
{
UdpClient client = new UdpClient (1237);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Available ()
{
using (UdpClient client = new UdpClient (1238)) {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void EnableBroadcastDefault ()
{
UdpClient client = new UdpClient ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void MulticastLoopbackDefault ()
{
UdpClient client = new UdpClient ();
}
[Test] // #6057
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveIPv6 ()
{
if (!Socket.OSSupportsIPv6)
{
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;
}
}
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";
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestExpires ()
{
var cookies = DoRequest (A);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestInvalidCookie ()
{
var cookies = DoRequest (B);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestLocalCulture ()
{
var old = Thread.CurrentThread.CurrentCulture;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestMultiple ()
{
var cookies = DoRequest (D);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestMultiple2 ()
{
var cookies = DoRequest (E);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestQuotation ()
{
var cookies = DoRequest (F);
{
Socket socket;
string[] headers;
+ Exception ex;
public Listener (params string[] headers)
{
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)
}
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);
+ }
}
}
}
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
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
}\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
}\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
}\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
}\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
}\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
}\r
\r
[Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+ [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
public void Resolve ()\r
{\r
SubTestResolve (site1Name);\r
}\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
}\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
}\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
}\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
}\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
namespace MonoTests.System.Net
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class FileWebRequestTest
{
private string _tempDirectory;
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;
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
}
}
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ContentOffset ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Credentials ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Method ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadWriteTimeout ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Timeout ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultValues ()
{
FtpWebRequest request = (FtpWebRequest) WebRequest.Create ("ftp://www.contoso.com");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void RenameTo ()
{
try {
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFile1 ()
{
ServerPut sp = new ServerPut ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFile_WebClient ()
{
ServerPut sp = new ServerPut ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DownloadFile1 ()
{
DownloadFile (new ServerDownload ());
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DownloadFile2 ()
{
// Some embedded FTP servers in Industrial Automation Hardware report
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DeleteFile1 ()
{
ServerDeleteFile sp = new ServerDeleteFile ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ListDirectory1 ()
{
ServerListDirectory sp = new ServerListDirectory ();
namespace MonoTests.System.Net {
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class HttpListener2Test {
private HttpListener _listener = null;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test1 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test2 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test3 ()
{
StringBuilder bad = new StringBuilder ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test4 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test5 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test6 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test7 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test8 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test9 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test10 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test11 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test12 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test13 ()
{
var port = NetworkHelpers.FindFreePort ();
ManualResetEvent test_evt;
bool test14_error;
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test14 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test15 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test16 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test17 ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test_MultipleClosesOnOuputStreamAllowed ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReceiveCookiesFromClient ()
{
sendCookiePort = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void SendCookiestoClient ()
{
receiveCookiePort = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void MultiResponses ()
{
echoServerPort = NetworkHelpers.FindFreePort ();
}
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class HttpListenerBugs {
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestNonChunkedAsync ()
{
var port = NetworkHelpers.FindFreePort ();
// 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 ();
// 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);
}
[Test] // bug #513849
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ClosePort ()
{
var port = NetworkHelpers.FindFreePort ();
// does not also listen to another interface.
//
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BindToSingleInterface ()
{
IPAddress [] machineAddress = null;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BindToAllInterfaces ()
{
var h = new HttpListener ();
// Test case for bug #31209
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Test_EmptyLineAtStart ()
{
var port = NetworkHelpers.FindFreePort ();
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 ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultProperties ()
{
HttpListener listener = new HttpListener ();
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AddOne ()
{
HttpListener listener = new HttpListener ();
}
[Test]
- [Category ("RequiresBSDSockets")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Duplicate ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void EndsWithSlash ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DifferentPath ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NL_Clear ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NL_Remove ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NL_RemoveBadUri ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ArgumentException))]
+#endif
public void NL_AddBadUri ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ArgumentException))]
+#endif
public void NoHostInUrl ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void MultipleSlashes ()
{
// this one throws on Start(), not when adding it.
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PercentSign ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Disposed1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void Disposed2 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void Disposed3 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void Disposed4 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void Disposed5 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Disposed6 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Disposed7 ()
{
HttpListener listener = new HttpListener ();
namespace MonoTests.System.Net
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class HttpListenerRequestTest
{
[Test]
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpMethod ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpBasicAuthScheme ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpRequestUriIsNotDecoded ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpRequestIsLocal ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test] // #29927
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpRequestUriUnescape ()
{
var prefix = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
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 ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Start1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Stop1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (InvalidOperationException))]
+#endif
public void GetContext1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (InvalidOperationException))]
+#endif
public void GetContext2 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (InvalidOperationException))]
+#endif
public void BeginGetContext1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetContext2 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultHttpPort ()
{
if (!CanOpenPort (80))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultHttpsPort ()
{
if (!CanOpenPort (443))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TwoListeners_SameAddress ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (HttpListenerException))]
+#endif
public void TwoListeners_SameURL ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (HttpListenerException))]
+#endif
public void MultipleSlashes ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (HttpListenerException))]
+#endif
public void PercentSign ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseBeforeStart ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseTwice ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StartStopStart ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StartStopDispose ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AbortBeforeStart ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AbortTwice ()
{
if (!CanOpenPort (port))
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PropertiesWhenClosed1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosed2 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosedSet1 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosedSet2 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosedSet3 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosedSet4 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ObjectDisposedException))]
+#endif
public void PropertiesWhenClosedSet5 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PropertiesWhenClosed3 ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseWhileBegin ()
{
HttpListener listener = new HttpListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AbortWhileBegin ()
{
HttpListener listener = new HttpListener ();
}
[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
}
[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
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ConnectionReuse ()
{
var uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UserHeaderWithDoubleMultiValue ()
{
string uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HttpClientIsDisconnectedCheckForWriteException()
{
string uri = "http://localhost:" + NetworkHelpers.FindFreePort () + "/";
namespace MonoTests.System.Net
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class HttpWebRequestTest
{
private Random rand = new Random ();
[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");
[Test]
[Category("InetAccess")]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Sync ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AddRange ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
}
[Test] // bug #471782
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CloseRequestStreamAfterReadingResponse ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
#endif
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Missing_ContentEncoding ()
{
ServicePointManager.CertificatePolicy = new AcceptAllPolicy ();
}
[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
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStream_Body_NotAllowed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #465613
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStream_NoBuffering ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStream_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetResponse_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void EndGetRequestStream_AsyncResult_Null ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void EndGetResponse_AsyncResult_Null ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #429200
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetRequestStream ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetRequestStream_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #511851
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetResponse_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #324300
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AllowAutoRedirect ()
{
IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PostAndRedirect_NoCL ()
{
IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PostAndRedirect_CL ()
{
IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PostAnd401 ()
{
IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #513087
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NonStandardVerb ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
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);
}
[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 ();
}
[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
return Encoding.UTF8.GetBytes (sw.ToString ());
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NtlmAuthentication ()
{
NtlmServer server = new NtlmServer ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStream ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStreamNoClose ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetRequestStreamCancelIfNotAllBytesWritten ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetRequestStream2 ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetRequestStreamNotAllBytesWritten ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetRequestStreamTimeout ()
{
this.DoRequest (
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginWrite ()
{
byte[] received = new byte[data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginWriteAfterAbort ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PrematureStreamCloseAborts ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write ()
{
byte [] received = new byte [data64KB.Length];
**/
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadTimeout2 ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadServerAborted ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetResponse2 ()
{
byte [] received = new byte [data64KB.Length];
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginGetResponseAborts ()
{
ManualResetEvent aborted = new ManualResetEvent(false);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TestLargeDataReading ()
{
int near2GBStartPosition = rand.Next (int.MaxValue - 500, int.MaxValue);
}
[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");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NoHost ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
}
[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");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void HostAndPort ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com:80");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PortRange ()
{
for (int i = 0; i < 65536; i++) {
}
[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");
}
[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");
}
[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");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void NoDate ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UtcDate ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://go-mono.com");
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AddAndRemoveDate ()
{
// Neil Armstrong set his foot on Moon
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
// Bug #12393
public void TestIPv6Host ()
{
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AllowReadStreamBuffering ()
{
var hr = WebRequest.CreateHttp ("http://www.google.com");
#endif
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CookieContainerTest ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class HttpRequestStreamTest
{
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginRead ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanRead ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanSeek ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test] // bug #324182
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanWrite ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadByte ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Seek ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Buffer_Null ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Count_Negative ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Count_Overflow ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Offset_Negative ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Offset_Overflow ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void WriteByte_Request_Aborted ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void WriteTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[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 ()
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();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Close_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ContentEncoding_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ContentLength_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ContentType_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Cookies_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetResponseHeader_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void GetResponseStream_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Headers_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void LastModified_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Method_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ProtocolVersion_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ResponseUri_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Server_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StatusCode_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StatusDescription_Disposed ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[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();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void BeginWrite ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanSeek ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test] // bug #324182
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CanWrite ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read_Buffer_Null ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read_Count_Negative ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read_Count_Overflow ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read_Offset_Negative ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Read_Offset_Overflow ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void ReadTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void Write ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void WriteTimeout ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
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
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
//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
// 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
\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
}\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
}\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
namespace MonoTests.System.Net
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class WebClientTest
{
private string _tempFolder;
[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 ();
}
[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 ();
[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) =>
[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) =>
[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) =>
[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) =>
[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 ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void AddRestricted ()
{
col = CreateRestrictedHeaders ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void RemoveRestricted ()
{
col = CreateRestrictedHeaders ();
//\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
}\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
}\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
}\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
}\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
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
{\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
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
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
../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
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
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
../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
../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
../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
--- /dev/null
+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
#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
+++ /dev/null
-? 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
[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
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;
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;
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]);
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 {
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) {
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 ()
+++ /dev/null
-//
-// 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)
- {
- }
- }
-}
using System.Security;
using System.Text;
using System.Runtime.InteropServices;
-
-#if !MOBILE
using System.Security.AccessControl;
-#endif
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,
return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
FileShare.None, bufferSize, options);
}
-#endif
public static StreamWriter CreateText (string path)
{
return MonoIO.ExistsFile (path, out error);
}
-#if !MOBILE
public static FileSecurity GetAccessControl (string path)
{
// AccessControlSections.Audit requires special permissions.
{
return new FileSecurity (path, includeSections);
}
-#endif
public static FileAttributes GetAttributes (string path)
{
}
}
-#if !MOBILE
public static void SetAccessControl (string path,
FileSecurity fileSecurity)
{
fileSecurity.PersistModifications (path);
}
-#endif
public static void SetAttributes (string path,
FileAttributes fileAttributes)
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
{
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,
: 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)
throw exc;
}
-#if !MOBILE
public FileSecurity GetAccessControl ()
{
if (safeHandle.IsClosed)
fileSecurity.PersistModifications (SafeFileHandle);
}
-#endif
public override Task FlushAsync (CancellationToken cancellationToken)
{
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;
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;
[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
// 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;
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");
+++ /dev/null
-//
-// 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)
- {
- }
- }
-}
+++ /dev/null
-//
-// 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)
- {
- }
- }
-}
+++ /dev/null
-//
-// 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)
- {
- }
- }
-}
Batch = 0,
Interactive = 1,
LowLatency = 2,
- SustainedLowLatency = 3
+ SustainedLowLatency = 3,
+ NoGCRegion = 4
}
}
{
SetAuditRule((AuditRule)rule);
}
+
+ internal void Persist (SafeHandle handle)
+ {
+ PersistModifications (handle);
+ }
}
}
{
Persist (name, includeSections, null);
}
-
- internal void Persist (SafeHandle handle)
- {
- PersistModifications (handle);
- }
-
+
internal void PersistModifications (SafeHandle handle)
{
WriteLock();
SetAuditRule((AuditRule)rule);
}
- protected new void Persist (SafeHandle handle)
+ protected void Persist (SafeHandle handle)
{
WriteLock ();
try {
{
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)]
throw new PlatformNotSupportedException ("Thread.Resume is not supported on the current platform.");
}
#endif
+
+ public void DisableComObjectEagerCleanup ()
+ {
+ throw new PlatformNotSupportedException ();
+ }
}
}
* 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)]
return trace.ToString ();
}
}
-#if !MOBILE
+
/// <summary>
/// Get a fully qualified path to the system directory
/// </summary>
return GetFolderPath (SpecialFolder.System);
}
}
-#endif
+
/// <summary>
/// Get the number of milliseconds that have elapsed since the system was booted
/// </summary>
{
return Append (new Text.StringBuilder ()).ToString ();
}
+
+ public int Rank {
+ get {
+ return dimensions;
+ }
+ }
+
+ public bool IsBound {
+ get {
+ return bound;
+ }
+ }
}
internal class PointerSpec : ModifierSpec
// 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);
+ }
}
}
[Test]
+ // Casts don't work with unfinished types
+ [Category ("NotWorking")]
[Category ("NotDotNet")]
public void IsAssignableFrom_NotCreated_Array ()
{
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; }
}
get { return ""; }
set {}
}
+
+ public override void Foo () { }
}
class Sub: Base
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
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
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
../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
../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
../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
+++ /dev/null
-#include corlib.dll.sources
-../referencesource/mscorlib/system/runtime/compilerservices/idispatchconstantattribute.cs
public static DebugInfoGenerator CreatePdbGenerator() {
return new SymbolDocumentGenerator();
}
+#else
+ public static DebugInfoGenerator CreatePdbGenerator() {
+ throw new PlatformNotSupportedException();
+ }
#endif
/// <summary>
/// Marks a sequence point.
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;
m_leftSource = leftSource;
m_rightSource = rightSource;
+#if !MONO
m_partitionIndex = partitionIndex;
+#endif
m_comparer = comparer;
m_cancellationToken = cancellationToken;
}
/// <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;
{
m_child = child;
m_ordinalIndexState = m_child.OrdinalIndexState;
+#if !MONO
m_orderOn = orderOn;
+#endif
}
internal override QueryResults<TSource> Open(QuerySettings settings, bool preferStriping)
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
bool preferStriping)
: base(leftChildQueryResults, rightChildQueryResults, concatOp, settings, preferStriping)
{
+#if !MONO
m_concatOp = concatOp;
+#endif
Contract.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible);
m_leftChildCount = leftChildQueryResults.ElementsCount;
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,
m_childQueryResults = childQueryResults;
m_op = op;
m_settings = settings;
+#if !MONO
m_preferStriping = preferStriping;
+#endif
}
internal override bool IsIndexible
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
m_partitionIndex = partitionIndex;
m_buffers = buffers;
m_bufferLock = bufferLock;
+#if !MONO
m_taskScheduler = taskScheduler;
+#endif
m_autoBuffered = autoBuffered;
}
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;
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();
}
// 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))
nodes[i].WriteTo(xmlWriter);
}
-#if !MOBILE
internal static string AddDefaultSchemaMethodName = "AddDefaultSchema";
public static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName)
{
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("typeQName");
SchemaExporter.AddDefaultXmlType(schemas, typeQName.Name, typeQName.Namespace);
}
-#endif
}
}
// </copyright>
//------------------------------------------------------------------------------
+#if MONO
+#undef FEATURE_PAL
+#endif
+
namespace System.Net.Sockets {
using System.Collections;
using System.Collections.Generic;
/// 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
//
// 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
#if !FEATURE_PAL // perfcounter
internal static volatile bool s_PerfCountersEnabled;
#endif
+#endif // !MONO
//************* constructors *************************
DualMode = true;
}
+#if !MONO
/// <devdoc>
/// <para>
/// Initializes a new instance of the <see cref='Sockets.Socket'/> class.
return m_RemoteEndPoint;
}
}
+#endif // !MONO
/// <devdoc>
/// <para>
/// </devdoc>
public IntPtr Handle {
get {
+#if !MONO
ExceptionHelper.UnmanagedPermission.Demand();
+#endif
return m_Handle.DangerousGetHandle();
}
}
+#if !MONO
internal SafeCloseSocket SafeHandle {
get {
return m_Handle;
willBlock = current;
}
}
+#endif // !MONO
public bool UseOnlyOverlappedIO{
get {
}
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
return m_IsConnected;
}
}
+#endif // !MONO
/// <devdoc>
/// <para>
}
}
-
+#if !MONO
public bool IsBound{
get{
return (m_RightEndPoint != null);
}
}
-
+#endif // !MONO
public bool ExclusiveAddressUse{
get {
}
}
+#if !MONO
public bool NoDelay {
get {
return (int)GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay) != 0 ? true : false;
SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
}
}
+#endif // !MONO
public short Ttl{
get {
}
}
+#if !MONO
public bool MulticastLoopback{
get {
if (addressFamily == AddressFamily.InterNetwork) {
}
}
-
public bool EnableBroadcast{
get {
return (int)GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast) != 0 ? true : false;
SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
}
}
-
+#endif // !MONO
+
public bool DualMode {
get {
if (AddressFamily != AddressFamily.InterNetworkV6) {
-
+#if !MONO
/// <devdoc>
/// <para>Associates a socket with an end point.</para>
/// </devdoc>
}
return socket;
}
-
+#endif // !MONO
/// <devdoc>
/// <para>Sends a data buffer to a connected socket.</para>
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) {
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Send", bytesTransferred);
return bytesTransferred;
}
-
-
+#endif // !MONO
/// <devdoc>
/// <para>Sends a file to
SendFile(fileName,null,null,TransmitFileOptions.UseDefaultWorkerThread);
}
-
-
+#if !MONO
/// <devdoc>
/// <para>Sends a file to
/// a connected socket.</para>
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "SendFile", errorCode);
return;
}
+#endif // !MONO
#endif // !FEATURE_PAL
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", "");
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>
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>
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) {
return bytesTransferred;
}
-
+#endif // !MONO
public int Receive(IList<ArraySegment<byte>> buffers) {
return Receive(buffers,SocketFlags.None);
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) {
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>
return ReceiveFrom(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None, ref remoteEP);
}
+#if !MONO
// UE
/// <devdoc>
/// <para>[To be supplied.]</para>
return realOptionLength;
}
+#endif // !MONO
// UE
/// <devdoc>
return IOControl(unchecked((int)ioControlCode),optionInValue,optionOutValue);
}
+#if !MONO
internal int IOControl( IOControlCode ioControlCode,
IntPtr optionInValue,
int inValueSize,
return realOptionLength;
}
+#endif // !MONO
public void SetIPProtectionLevel(IPProtectionLevel level) {
if (level == IPProtectionLevel.Unspecified) {
}
}
+#if !MONO
/// <devdoc>
/// <para>
/// Sets the specified option to the specified value.
SelectFileDescriptor(checkWrite, writefileDescriptorSet);
SelectFileDescriptor(checkError, errfileDescriptorSet);
}
+#endif // !MONO
#if !FEATURE_PAL
/// <devdoc>
}
#endif
-
+#if !MONO
//
// Async Winsock Support, the following functions use either
// the Async Winsock support to do overlapped I/O WSASend/WSARecv
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){
return result;
}
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::DoBeginDisconnect() ");
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
#endif
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() ");
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");
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndDisconnect", null);
return;
}
-
+#endif // !MONO
/*++
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)
{
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) {
}
#endif // !FEATURE_PAL
-
+#endif // !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
return result;
}
-
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
}
return errorCode;
}
-
+#endif // !MONO
/*++
return bytesTransferred;
}
-
+#if !MONO
public int EndSend(IAsyncResult asyncResult, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndSend", asyncResult);
if (CleanedUp) {
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
//
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndSendTo", bytesTransferred);
return bytesTransferred;
}
-
+#endif // !MONO
/*++
}
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
return errorCode;
}
-
+#endif // !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
return result;
}
-
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
private int m_LastReceiveTick;
#endif
+#endif // !MONO
+
/*++
Routine Description:
return bytesTransferred;
}
-
+#if !MONO
public int EndReceive(IAsyncResult asyncResult, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndReceive", asyncResult);
if (CleanedUp) {
}
}
}
+#endif // !MONO
#if !FEATURE_PAL
+#if !MONO
private bool CanUseAcceptEx
{
get
(Thread.CurrentThread.IsThreadPoolThread || SettingsSectionInternal.Section.AlwaysUseCompletionPortsForAccept || m_IsDisconnected);
}
}
+#endif // !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// This is the true async version that uses AcceptEx
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
throw socketException;
}
}
-
+#endif // !MONO
#endif // !FEATURE_PAL
-
/*++
Routine Description:
--*/
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
}
return acceptedSocket;
}
+#endif // !MONO
#if !FEATURE_PAL
-
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
return socket;
}
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
}
return socket;
}
-
+#endif // !MONO
#endif // !FEATURE_PAL
-
+#if !MONO
/// <devdoc>
/// <para>
/// Disables sends and receives on a socket.
Interlocked.CompareExchange(ref m_AcceptQueueOrConnectResult, new Queue(16), null);
return (Queue)m_AcceptQueueOrConnectResult;
}
+#endif // !MONO
internal bool CleanedUp {
get {
}
}
+#if !MONO
internal TransportType Transport {
get {
return
m_AsyncEvent.Close();
}
}
+#endif // !MONO
public void Dispose() {
Dispose(true);
Dispose(false);
}
+#if !MONO
// this version does not throw.
internal void InternalShutdown(SocketShutdown how) {
GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::InternalShutdown() how:" + how.ToString());
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) {
}
}
#endif // SOCKETTHREADPOOL
+#endif // !MONO
}
}
#if NETSTANDARD
+ [CLSCompliant (false)]
protected IDictionary Caps
{
get
}
}
+ [CLSCompliant (false)]
protected IDictionary CapNames
{
get
return newcached;
}
-#if !(SILVERLIGHT||FULL_AOT_RUNTIME)
+#if !SILVERLIGHT
/*
* True if the O option was set
*/
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
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
}
}
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
}
}
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 {
===========================================================*/
using System;
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
using System.Security.AccessControl;
#endif
using System.Security.Permissions;
}
}
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
public FileSecurity GetAccessControl()
[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 {
#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 {
// 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 {
// 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 {
[System.Runtime.InteropServices.ComVisible(true)]
sealed public class BinaryFormatter :
-#if !FEATURE_REMOTING
+#if !FEATURE_REMOTING && !MONO
IFormatter
#else
IRemotingFormatter
{
#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;
: base(info, context)
{
}
-#if !MOBILE
+
public Object ExceptionState
{
[System.Security.SecuritySafeCritical] // auto-generated
get {return Thread.CurrentThread.AbortReason;}
}
-#endif
}
}
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
--- /dev/null
+.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
+}
+
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);
--- /dev/null
+<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>
--- /dev/null
+<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>
--- /dev/null
+Imports System
+
+Public Module mainmod
+ Sub Main()
+ Console.WriteLine("Hello, world!")
+ End sub
+End Module
common_sources = \
$(platform_sources) \
assembly.c \
+ assembly-internals.h \
attach.h \
attach.c \
cil-coff.h \
handle.c \
handle.h \
w32mutex.h \
- w32mutex-utils.h \
w32semaphore.h \
w32event.h \
w32handle-namespace.h \
* 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
{
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.
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);
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);
* 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)
return mono_image_alloc (klass->image, size);
}
-static gpointer
+gpointer
mono_class_alloc0 (MonoClass *klass, int size)
{
gpointer res;
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
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;
}
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;
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;
}
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);
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;
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;
}
/*
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)
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) {
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);
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));
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;
}
if (method->signature)
mono_metadata_free_inflated_signature (method->signature);
+ if (method->wrapper_type)
+ g_free (((MonoMethodWrapper*)method)->method_data);
+
g_free (method);
}
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
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);
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);
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)
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)
{
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;
{
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.
#ifdef MONOTOUCH
acfg->global_symbols = TRUE;
#endif
+
+#ifdef TARGET_ANDROID
+ acfg->llvm_owriter_supported = FALSE;
+#endif
}
#ifdef TARGET_ARM64
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);
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))
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)
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);
#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
}
}
+/*
+ * 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; \
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) {
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;
}
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 {
GPtrArray *bblock_list;
char *method_name;
GHashTable *jit_callees;
+ LLVMValueRef long_bb_break_var;
} EmitContext;
typedef struct {
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;
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;
}
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;
}
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)) {
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;
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",
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)
#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))
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;
}
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;
}
}
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);
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)) {
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;
}
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 \
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
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__ */
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);
}
/**
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
}
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)
void
mono_threads_platform_unregister (MonoThreadInfo *info)
{
- mono_threads_platform_set_exited (info);
+ g_assert (info->handle);
+
+ CloseHandle (info->handle);
+ info->handle = NULL;
}
int
}
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
MonoThreadInfo *info;
int small_id;
gboolean result;
+ gpointer handle;
info = (MonoThreadInfo *) arg;
g_assert (info);
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.
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
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
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);