You've already forked linux-packaging-mono
Imported Upstream version 6.12.0.86
Former-commit-id: 7a84ce7d08c42c458ac8e74b27186ca863315d79
This commit is contained in:
parent
92747312ea
commit
0b380204a4
@ -90,6 +90,10 @@ using System.Runtime.InteropServices;
|
||||
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
|
||||
#if WASM
|
||||
[assembly: InternalsVisibleTo ("WebAssembly.Net.WebSockets, PublicKey=00240000048000009400000006020000002400005253413100040000010001004b86c4cb78549b34bab61a3b1800e23bfeb5b3ec390074041536a7e3cbd97f5f04cf0f857155a8928eaa29ebfd11cfbbad3ba70efea7bda3226c6a8d370a4cd303f714486b6ebc225985a638471e6ef571cc92a4613c00b8fa65d61ccee0cbe5f36330c9a01f4183559f1bef24cc2917c6d913e3a541333a1d05d9bed22b38cb")]
|
||||
#endif
|
||||
|
||||
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Stack<>))]
|
||||
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Queue<>))]
|
||||
[assembly: TypeForwardedTo (typeof (System.IO.Enumeration.FileSystemName))]
|
||||
|
@ -116,6 +116,10 @@ API_BIN_REFS += System.Configuration
|
||||
LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
|
||||
endif
|
||||
|
||||
ifeq (wasm,$(PROFILE))
|
||||
API_BIN_REFS += WebAssembly.Net.WebSockets
|
||||
endif
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
Test/test-config-file \
|
||||
Test/System.Security.Cryptography.X509Certificates/pkits/Makefile \
|
||||
|
@ -54,13 +54,13 @@ namespace System.Net.NetworkInformation {
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static bool ParseRouteInfo_internal(string iface, out string[] gw_addr_list);
|
||||
private extern static bool ParseRouteInfo_icall (string iface, out string[] gw_addr_list);
|
||||
|
||||
public override GatewayIPAddressInformationCollection GatewayAddresses {
|
||||
get {
|
||||
var gateways = new IPAddressCollection ();
|
||||
string[] gw_addrlist;
|
||||
if (!ParseRouteInfo_internal (this.iface.Name.ToString(), out gw_addrlist))
|
||||
if (!ParseRouteInfo_icall (this.iface.Name.ToString(), out gw_addrlist))
|
||||
return new GatewayIPAddressInformationCollection ();
|
||||
|
||||
for(int i=0; i<gw_addrlist.Length; i++) {
|
||||
|
@ -46,13 +46,13 @@ namespace System.Net.NetworkInformation {
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static bool ParseRouteInfo_internal(string iface, out string[] gw_addr_list);
|
||||
private extern static bool ParseRouteInfo_icall (string iface, out string[] gw_addr_list);
|
||||
|
||||
public override GatewayIPAddressInformationCollection GatewayAddresses {
|
||||
get {
|
||||
var gateways = new IPAddressCollection ();
|
||||
string[] gw_addrlist;
|
||||
if (!ParseRouteInfo_internal (this.iface.Name.ToString(), out gw_addrlist))
|
||||
if (!ParseRouteInfo_icall (this.iface.Name.ToString(), out gw_addrlist))
|
||||
return new GatewayIPAddressInformationCollection ();
|
||||
|
||||
for(int i=0; i<gw_addrlist.Length; i++) {
|
||||
|
@ -488,6 +488,26 @@ namespace System.Net.Security
|
||||
return Impl.WriteAsync (buffer, offset, count, cancellationToken);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return TaskToApm.Begin (Impl.ReadAsync (buffer, offset, count), callback, state);
|
||||
}
|
||||
|
||||
public override int EndRead (IAsyncResult asyncResult)
|
||||
{
|
||||
return TaskToApm.End<int> (asyncResult);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
return TaskToApm.Begin (Impl.WriteAsync (buffer, offset, count), callback, state);
|
||||
}
|
||||
|
||||
public override void EndWrite (IAsyncResult asyncResult)
|
||||
{
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
#else // !SECURITY_DEP
|
||||
const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform.";
|
||||
|
||||
|
@ -44,10 +44,10 @@ namespace System.Net.Sockets {
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
Socket.Blocking_internal (handle, false, out error);
|
||||
Socket.Blocking_icall (handle, false, out error);
|
||||
#if FULL_AOT_DESKTOP
|
||||
/* It's only for platforms that do not have working syscall abort mechanism, like WatchOS and TvOS */
|
||||
Socket.Shutdown_internal (handle, SocketShutdown.Both, out error);
|
||||
Socket.Shutdown_icall (handle, SocketShutdown.Both, out error);
|
||||
#endif
|
||||
|
||||
if (blocking_threads != null) {
|
||||
@ -93,7 +93,7 @@ namespace System.Net.Sockets {
|
||||
}
|
||||
}
|
||||
|
||||
Socket.Close_internal (handle, out error);
|
||||
Socket.Close_icall (handle, out error);
|
||||
|
||||
return error == 0;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace System.Net.Sockets
|
||||
const string TIMEOUT_EXCEPTION_MSG = "A connection attempt failed because the connected party did not properly respond" +
|
||||
"after a period of time, or established connection failed because connected host has failed to respond";
|
||||
|
||||
/* true if we called Close_internal */
|
||||
/* true if we called Close_icall */
|
||||
bool is_closed;
|
||||
|
||||
bool is_listening;
|
||||
@ -163,7 +163,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Creates a new system socket, returning the handle */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern IntPtr Socket_internal (AddressFamily family, SocketType type, ProtocolType proto, out int error);
|
||||
extern static IntPtr Socket_icall (AddressFamily family, SocketType type, ProtocolType proto, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -188,7 +188,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
return Available_internal (safeHandle.DangerousGetHandle (), out error);
|
||||
return Available_icall (safeHandle.DangerousGetHandle (), out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -197,7 +197,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Returns the amount of data waiting to be read on socket */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static int Available_internal (IntPtr socket, out int error);
|
||||
extern static int Available_icall (IntPtr socket, out int error);
|
||||
|
||||
// FIXME: import from referencesource
|
||||
public bool EnableBroadcast {
|
||||
@ -296,7 +296,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
return LocalEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
|
||||
return LocalEndPoint_icall (safeHandle.DangerousGetHandle (), family, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -305,7 +305,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Returns the local endpoint details in addr and port */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static SocketAddress LocalEndPoint_internal (IntPtr socket, int family, out int error);
|
||||
extern static SocketAddress LocalEndPoint_icall (IntPtr socket, int family, out int error);
|
||||
|
||||
public bool Blocking {
|
||||
get { return is_blocking; }
|
||||
@ -327,7 +327,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
Blocking_internal (safeHandle.DangerousGetHandle (), block, out error);
|
||||
Blocking_icall (safeHandle.DangerousGetHandle (), block, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -335,7 +335,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
internal extern static void Blocking_internal(IntPtr socket, bool block, out int error);
|
||||
internal extern static void Blocking_icall (IntPtr socket, bool block, out int error);
|
||||
|
||||
public bool Connected {
|
||||
get { return is_connected; }
|
||||
@ -382,7 +382,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
|
||||
return RemoteEndPoint_icall (safeHandle.DangerousGetHandle (), family, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -391,7 +391,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Returns the remote endpoint details in addr and port */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static SocketAddress RemoteEndPoint_internal (IntPtr socket, int family, out int error);
|
||||
extern static SocketAddress RemoteEndPoint_icall (IntPtr socket, int family, out int error);
|
||||
|
||||
internal SafeHandle SafeHandle
|
||||
{
|
||||
@ -419,7 +419,7 @@ namespace System.Net.Sockets
|
||||
Socket [] sockets = list.ToArray ();
|
||||
|
||||
int error;
|
||||
Select_internal (ref sockets, microSeconds, out error);
|
||||
Select_icall (ref sockets, microSeconds, out error);
|
||||
|
||||
if (error != 0)
|
||||
throw new SocketException (error);
|
||||
@ -480,7 +480,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void Select_internal (ref Socket [] sockets, int microSeconds, out int error);
|
||||
extern static void Select_icall (ref Socket [] sockets, int microSeconds, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -514,7 +514,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
return Poll_internal (safeHandle.DangerousGetHandle (), mode, timeout, out error);
|
||||
return Poll_icall (safeHandle.DangerousGetHandle (), mode, timeout, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -522,7 +522,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
|
||||
extern static bool Poll_icall (IntPtr socket, SelectMode mode, int timeout, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -750,7 +750,7 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
|
||||
var ret = Accept_icall (safeHandle.DangerousGetHandle (), out error, blocking);
|
||||
return new SafeSocketHandle (ret, true);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
@ -759,7 +759,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Creates a new system socket, returning the handle */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static IntPtr Accept_internal (IntPtr sock, out int error, bool blocking);
|
||||
extern static IntPtr Accept_icall (IntPtr sock, out int error, bool blocking);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -797,7 +797,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
|
||||
Bind_icall (safeHandle.DangerousGetHandle (), sa, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -806,7 +806,7 @@ namespace System.Net.Sockets
|
||||
|
||||
// Creates a new system socket, returning the handle
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static void Bind_internal(IntPtr sock, SocketAddress sa, out int error);
|
||||
private extern static void Bind_icall (IntPtr sock, SocketAddress sa, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -833,7 +833,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
|
||||
Listen_icall (safeHandle.DangerousGetHandle (), backlog, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -841,7 +841,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void Listen_internal (IntPtr sock, int backlog, out int error);
|
||||
extern static void Listen_icall (IntPtr sock, int backlog, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -1124,7 +1124,7 @@ namespace System.Net.Sockets
|
||||
// an error. Better to just close the socket and move on.
|
||||
sockares.socket.connect_in_progress = false;
|
||||
sockares.socket.m_Handle.Dispose ();
|
||||
sockares.socket.m_Handle = new SafeSocketHandle (sockares.socket.Socket_internal (sockares.socket.addressFamily, sockares.socket.socketType, sockares.socket.protocolType, out error), true);
|
||||
sockares.socket.m_Handle = new SafeSocketHandle (Socket_icall (sockares.socket.addressFamily, sockares.socket.socketType, sockares.socket.protocolType, out error), true);
|
||||
if (error != 0) {
|
||||
sockares.Complete (new SocketException (error), true);
|
||||
return false;
|
||||
@ -1218,7 +1218,7 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
Connect_internal (safeHandle.DangerousGetHandle (), sa, out error, blocking);
|
||||
Connect_icall (safeHandle.DangerousGetHandle (), sa, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
@ -1226,7 +1226,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* Connects to the remote address */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void Connect_internal(IntPtr sock, SocketAddress sa, out int error, bool blocking);
|
||||
extern static void Connect_icall (IntPtr sock, SocketAddress sa, out int error, bool blocking);
|
||||
|
||||
/* Returns :
|
||||
* - false when it is ok to use RemoteEndPoint
|
||||
@ -1363,7 +1363,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
|
||||
Disconnect_icall (safeHandle.DangerousGetHandle (), reuse, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -1371,7 +1371,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void Disconnect_internal (IntPtr sock, bool reuse, out int error);
|
||||
extern static void Disconnect_icall (IntPtr sock, bool reuse, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -1644,27 +1644,27 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, count, flags, out error, blocking);
|
||||
return Receive_array_icall (safeHandle.DangerousGetHandle (), bufarray, count, flags, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int Receive_internal (IntPtr sock, WSABUF* bufarray, int count, SocketFlags flags, out int error, bool blocking);
|
||||
extern static unsafe int Receive_array_icall (IntPtr sock, WSABUF* bufarray, int count, SocketFlags flags, out int error, bool blocking);
|
||||
|
||||
static unsafe int Receive_internal (SafeSocketHandle safeHandle, byte* buffer, int count, SocketFlags flags, out int error, bool blocking)
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return Receive_internal (safeHandle.DangerousGetHandle (), buffer, count, flags, out error, blocking);
|
||||
return Receive_icall (safeHandle.DangerousGetHandle (), buffer, count, flags, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int Receive_internal(IntPtr sock, byte* buffer, int count, SocketFlags flags, out int error, bool blocking);
|
||||
extern static unsafe int Receive_icall (IntPtr sock, byte* buffer, int count, SocketFlags flags, out int error, bool blocking);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -1884,14 +1884,14 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return ReceiveFrom_internal (safeHandle.DangerousGetHandle (), buffer, count, flags, ref sockaddr, out error, blocking);
|
||||
return ReceiveFrom_icall (safeHandle.DangerousGetHandle (), buffer, count, flags, ref sockaddr, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int ReceiveFrom_internal(IntPtr sock, byte* buffer, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error, bool blocking);
|
||||
extern static unsafe int ReceiveFrom_icall (IntPtr sock, byte* buffer, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error, bool blocking);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2209,27 +2209,27 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return Send_internal (safeHandle.DangerousGetHandle (), bufarray, count, flags, out error, blocking);
|
||||
return Send_array_icall (safeHandle.DangerousGetHandle (), bufarray, count, flags, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int Send_internal (IntPtr sock, WSABUF* bufarray, int count, SocketFlags flags, out int error, bool blocking);
|
||||
extern static unsafe int Send_array_icall (IntPtr sock, WSABUF* bufarray, int count, SocketFlags flags, out int error, bool blocking);
|
||||
|
||||
static unsafe int Send_internal (SafeSocketHandle safeHandle, byte* buffer, int count, SocketFlags flags, out int error, bool blocking)
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return Send_internal (safeHandle.DangerousGetHandle (), buffer, count, flags, out error, blocking);
|
||||
return Send_icall (safeHandle.DangerousGetHandle (), buffer, count, flags, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int Send_internal(IntPtr sock, byte* buffer, int count, SocketFlags flags, out int error, bool blocking);
|
||||
extern static unsafe int Send_icall (IntPtr sock, byte* buffer, int count, SocketFlags flags, out int error, bool blocking);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2399,14 +2399,14 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, count, flags, sa, out error, blocking);
|
||||
return SendTo_icall (safeHandle.DangerousGetHandle (), buffer, count, flags, sa, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static unsafe int SendTo_internal (IntPtr sock, byte* buffer, int count, SocketFlags flags, SocketAddress sa, out int error, bool blocking);
|
||||
extern static unsafe int SendTo_icall (IntPtr sock, byte* buffer, int count, SocketFlags flags, SocketAddress sa, out int error, bool blocking);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2462,14 +2462,14 @@ namespace System.Net.Sockets
|
||||
{
|
||||
try {
|
||||
safeHandle.RegisterForBlockingSyscall ();
|
||||
return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags, out error, blocking);
|
||||
return SendFile_icall (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags, out error, blocking);
|
||||
} finally {
|
||||
safeHandle.UnRegisterForBlockingSyscall ();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static bool SendFile_internal (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags, out int error, bool blocking);
|
||||
extern static bool SendFile_icall (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags, out int error, bool blocking);
|
||||
|
||||
delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
|
||||
|
||||
@ -2527,7 +2527,7 @@ namespace System.Net.Sockets
|
||||
#region DuplicateAndClose
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
static extern bool Duplicate_internal(IntPtr handle, int targetProcessId, out IntPtr duplicateHandle, out MonoIOError error);
|
||||
static extern bool Duplicate_icall (IntPtr handle, int targetProcessId, out IntPtr duplicateHandle, out MonoIOError error);
|
||||
|
||||
[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)
|
||||
@ -2540,7 +2540,7 @@ namespace System.Net.Sockets
|
||||
(useOverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
|
||||
|
||||
IntPtr duplicateHandle;
|
||||
if (!Duplicate_internal (Handle, targetProcessId, out duplicateHandle, out MonoIOError error))
|
||||
if (!Duplicate_icall (Handle, targetProcessId, out duplicateHandle, out MonoIOError error))
|
||||
throw MonoIO.GetException (error);
|
||||
|
||||
si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)addressFamily, (int)socketType, (int)protocolType, is_bound ? 1 : 0, (long)duplicateHandle);
|
||||
@ -2607,7 +2607,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
|
||||
GetSocketOption_arr_icall (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -2615,14 +2615,14 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
|
||||
extern static void GetSocketOption_arr_icall (IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
|
||||
|
||||
static void GetSocketOption_obj_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error)
|
||||
{
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
GetSocketOption_obj_internal (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
|
||||
GetSocketOption_obj_icall (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -2630,7 +2630,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
|
||||
extern static void GetSocketOption_obj_icall (IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2716,7 +2716,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
|
||||
SetSocketOption_icall (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -2724,7 +2724,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error);
|
||||
extern static void SetSocketOption_icall (IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2751,7 +2751,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
return IOControl_internal (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
|
||||
return IOControl_icall (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -2762,7 +2762,7 @@ namespace System.Net.Sockets
|
||||
* and Winsock are FIONREAD, FIONBIO and SIOCATMARK. Anything else will depend on the system
|
||||
* except SIO_KEEPALIVE_VALS which is properly handled on both windows and linux. */
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static int IOControl_internal (IntPtr sock, int ioctl_code, byte [] input, byte [] output, out int error);
|
||||
extern static int IOControl_icall (IntPtr sock, int ioctl_code, byte [] input, byte [] output, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2781,7 +2781,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
internal extern static void Close_internal (IntPtr socket, out int error);
|
||||
internal extern static void Close_icall (IntPtr socket, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2818,7 +2818,7 @@ namespace System.Net.Sockets
|
||||
bool release = false;
|
||||
try {
|
||||
safeHandle.DangerousAddRef (ref release);
|
||||
Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
|
||||
Shutdown_icall (safeHandle.DangerousGetHandle (), how, out error);
|
||||
} finally {
|
||||
if (release)
|
||||
safeHandle.DangerousRelease ();
|
||||
@ -2826,7 +2826,7 @@ namespace System.Net.Sockets
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
internal extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
|
||||
internal extern static void Shutdown_icall (IntPtr socket, SocketShutdown how, out int error);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -2859,7 +2859,7 @@ namespace System.Net.Sockets
|
||||
|
||||
/* We don't want to receive any more data */
|
||||
int error;
|
||||
Shutdown_internal (handle, SocketShutdown.Receive, out error);
|
||||
Shutdown_icall (handle, SocketShutdown.Receive, out error);
|
||||
|
||||
if (error != 0)
|
||||
return;
|
||||
@ -2868,14 +2868,14 @@ namespace System.Net.Sockets
|
||||
int ms = linger_timeout % 1000;
|
||||
if (ms > 0) {
|
||||
/* If the other end closes, this will return 'true' with 'Available' == 0 */
|
||||
Poll_internal (handle, SelectMode.SelectRead, ms * 1000, out error);
|
||||
Poll_icall (handle, SelectMode.SelectRead, ms * 1000, out error);
|
||||
if (error != 0)
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
LingerOption linger = new LingerOption (true, seconds);
|
||||
SetSocketOption_internal (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
|
||||
SetSocketOption_icall (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
|
||||
/* Not needed, we're closing upon return */
|
||||
//if (error != 0)
|
||||
// return;
|
||||
|
108
mcs/class/System/System.Net.WebSockets/WebSocketHandle.wasm.cs
Normal file
108
mcs/class/System/System.Net.WebSockets/WebSocketHandle.wasm.cs
Normal file
@ -0,0 +1,108 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace System.Net.WebSockets
|
||||
{
|
||||
internal sealed class WebSocketHandle
|
||||
{
|
||||
private WebSocketState _state = WebSocketState.Connecting;
|
||||
private WebAssembly.Net.WebSockets.ClientWebSocket _webSocket;
|
||||
|
||||
public static WebSocketHandle Create() => new WebSocketHandle();
|
||||
|
||||
public static bool IsValid(WebSocketHandle handle) => handle != null;
|
||||
|
||||
public WebSocketCloseStatus? CloseStatus => _webSocket?.CloseStatus;
|
||||
|
||||
public string CloseStatusDescription => _webSocket?.CloseStatusDescription;
|
||||
|
||||
public WebSocketState State => _webSocket?.State ?? _state;
|
||||
|
||||
public string SubProtocol => _webSocket?.SubProtocol;
|
||||
|
||||
public static void CheckPlatformSupport() { /* nop */ }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_state = WebSocketState.Closed;
|
||||
_webSocket?.Dispose();
|
||||
}
|
||||
|
||||
public void Abort()
|
||||
{
|
||||
_webSocket?.Abort();
|
||||
}
|
||||
|
||||
public Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) =>
|
||||
_webSocket.SendAsync(buffer, messageType, endOfMessage, cancellationToken);
|
||||
|
||||
public ValueTask SendAsync(ReadOnlyMemory<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) =>
|
||||
_webSocket.SendAsync(buffer, messageType, endOfMessage, cancellationToken);
|
||||
|
||||
public Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken) =>
|
||||
_webSocket.ReceiveAsync(buffer, cancellationToken);
|
||||
|
||||
public ValueTask<ValueWebSocketReceiveResult> ReceiveAsync(Memory<byte> buffer, CancellationToken cancellationToken) =>
|
||||
_webSocket.ReceiveAsync(buffer, cancellationToken);
|
||||
|
||||
public Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) =>
|
||||
_webSocket.CloseAsync(closeStatus, statusDescription, cancellationToken);
|
||||
|
||||
public Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) =>
|
||||
_webSocket.CloseOutputAsync(closeStatus, statusDescription, cancellationToken);
|
||||
|
||||
public async Task ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
|
||||
{
|
||||
// TODO #14480 : Not currently implemented, or explicitly ignored:
|
||||
// - ClientWebSocketOptions.UseDefaultCredentials
|
||||
// - ClientWebSocketOptions.Credentials
|
||||
// - ClientWebSocketOptions.Proxy
|
||||
// - ClientWebSocketOptions._sendBufferSize
|
||||
// throw new PlatformNotSupportedException ();
|
||||
// Establish connection to the server
|
||||
CancellationTokenRegistration registration = cancellationToken.Register(s => ((WebSocketHandle)s).Abort(), this);
|
||||
try
|
||||
{
|
||||
_webSocket = new WebAssembly.Net.WebSockets.ClientWebSocket ();//(options);
|
||||
foreach (var t in options.RequestedSubProtocols) {
|
||||
_webSocket.Options.AddSubProtocol (t);
|
||||
}
|
||||
|
||||
await _webSocket.ConnectAsync (uri, cancellationToken);
|
||||
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (_state < WebSocketState.Closed)
|
||||
{
|
||||
_state = WebSocketState.Closed;
|
||||
}
|
||||
|
||||
Abort();
|
||||
|
||||
if (exc is WebSocketException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
throw new WebSocketException(SR.net_webstatus_ConnectFailure, exc);
|
||||
}
|
||||
finally
|
||||
{
|
||||
registration.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -295,13 +295,13 @@ namespace System.Net {
|
||||
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
|
||||
private extern static bool GetHostByName_icall (string host, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static bool GetHostByAddr_internal(string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
|
||||
private extern static bool GetHostByAddr_icall (string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern static bool GetHostName_internal(out string h_name);
|
||||
private extern static bool GetHostName_icall (out string h_name);
|
||||
|
||||
static void Error_11001 (string hostName)
|
||||
{
|
||||
@ -372,7 +372,7 @@ namespace System.Net {
|
||||
|
||||
string h_name;
|
||||
string[] h_aliases, h_addrlist;
|
||||
bool ret = GetHostByAddr_internal(address, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
|
||||
bool ret = GetHostByAddr_icall (address, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
|
||||
if (!ret)
|
||||
Error_11001 (address);
|
||||
return (hostent_to_IPHostEntry (address, h_name, h_aliases, h_addrlist));
|
||||
@ -436,7 +436,7 @@ namespace System.Net {
|
||||
string h_name;
|
||||
string[] h_aliases, h_addrlist;
|
||||
|
||||
bool ret = GetHostByName_internal(hostName, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
|
||||
bool ret = GetHostByName_icall (hostName, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
|
||||
if (ret == false)
|
||||
Error_11001 (hostName);
|
||||
|
||||
@ -447,7 +447,7 @@ namespace System.Net {
|
||||
{
|
||||
string hostName;
|
||||
|
||||
bool ret = GetHostName_internal(out hostName);
|
||||
bool ret = GetHostName_icall (out hostName);
|
||||
|
||||
if (ret == false)
|
||||
Error_11001 (hostName);
|
||||
|
@ -237,8 +237,12 @@ namespace System.Net {
|
||||
}
|
||||
|
||||
if (ProcessInput (ms)) {
|
||||
if (!context.HaveError)
|
||||
context.Request.FinishInitialization ();
|
||||
if (!context.HaveError) {
|
||||
if (!context.Request.FinishInitialization()) {
|
||||
Close (true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.HaveError) {
|
||||
SendError ();
|
||||
|
@ -192,12 +192,12 @@ namespace System.Net {
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void FinishInitialization ()
|
||||
internal bool FinishInitialization ()
|
||||
{
|
||||
string host = UserHostName;
|
||||
if (version > HttpVersion.Version10 && (host == null || host.Length == 0)) {
|
||||
context.ErrorMessage = "Invalid host name";
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
string path;
|
||||
@ -223,7 +223,7 @@ namespace System.Net {
|
||||
|
||||
if (!Uri.TryCreate (base_uri + path, UriKind.Absolute, out url)){
|
||||
context.ErrorMessage = WebUtility.HtmlEncode ("Invalid url: " + base_uri + path);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
CreateQueryString (url.Query);
|
||||
@ -239,7 +239,7 @@ namespace System.Net {
|
||||
// 'identity' is not valid!
|
||||
if (t_encoding != null && !is_chunked) {
|
||||
context.Connection.SendError (null, 501);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ namespace System.Net {
|
||||
if (String.Compare (method, "POST", StringComparison.OrdinalIgnoreCase) == 0 ||
|
||||
String.Compare (method, "PUT", StringComparison.OrdinalIgnoreCase) == 0) {
|
||||
context.Connection.SendError (null, 411);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,6 +255,8 @@ namespace System.Net {
|
||||
ResponseStream output = context.Connection.GetResponseStream ();
|
||||
output.InternalWrite (_100continue, 0, _100continue.Length);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static string Unquote (String str) {
|
||||
|
@ -197,6 +197,9 @@ namespace MonoTests.System.Collections.Concurrent
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Category ("MultiThreaded")]
|
||||
#endif
|
||||
public void BasicRemoveEmptyTest ()
|
||||
{
|
||||
int result;
|
||||
@ -205,6 +208,9 @@ namespace MonoTests.System.Collections.Concurrent
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Category ("MultiThreaded")]
|
||||
#endif
|
||||
public void BasicRemoveTwiceTest()
|
||||
{
|
||||
bag.Add (1);
|
||||
|
@ -254,6 +254,9 @@ namespace MonoTests.System.Collections.Specialized {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void CaseInsensitive ()
|
||||
{
|
||||
// default constructor is case insensitive
|
||||
@ -347,6 +350,9 @@ namespace MonoTests.System.Collections.Specialized {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Remove ()
|
||||
{
|
||||
string[] items = { "mono", "MoNo", "mOnO", "MONO" };
|
||||
@ -414,6 +420,9 @@ namespace MonoTests.System.Collections.Specialized {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Constructor_IEqualityComparer_Null ()
|
||||
{
|
||||
NameValueCollection c1 = new NameValueCollection ((IEqualityComparer)null);
|
||||
@ -423,6 +432,9 @@ namespace MonoTests.System.Collections.Specialized {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Constructor_NameValueCollection ()
|
||||
{
|
||||
NameValueCollection c1 = new NameValueCollection (StringComparer.InvariantCultureIgnoreCase);
|
||||
|
@ -18,6 +18,7 @@ using NUnit.Framework;
|
||||
namespace MonoTests.System.ComponentModel
|
||||
{
|
||||
[TestFixture]
|
||||
[NUnit.Framework.CategoryAttribute ("NotWasm")]
|
||||
public class AsyncOperationManagerTest
|
||||
{
|
||||
[Test]
|
||||
|
@ -81,6 +81,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
|
||||
#endif
|
||||
public void CancelBackgroundWorker ()
|
||||
{
|
||||
BackgroundWorker bw = new BackgroundWorker ();
|
||||
@ -117,6 +120,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
|
||||
#endif
|
||||
public void ExceptionBackgroundWorker ()
|
||||
{
|
||||
BackgroundWorker bw = new BackgroundWorker ();
|
||||
@ -154,6 +160,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
|
||||
#endif
|
||||
public void CompleteBackgroundWorker ()
|
||||
{
|
||||
BackgroundWorker bw = new BackgroundWorker ();
|
||||
|
@ -151,6 +151,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort ()
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort1 ()
|
||||
{
|
||||
EventDescriptorCollection descriptors;
|
||||
@ -192,6 +195,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (String [])
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort2 ()
|
||||
{
|
||||
EventDescriptorCollection descriptors;
|
||||
@ -249,6 +255,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (IComparer)
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort3 ()
|
||||
{
|
||||
EventDescriptorCollection descriptors;
|
||||
@ -306,6 +315,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (String [], IComparer)
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort4 ()
|
||||
{
|
||||
EventDescriptorCollection descriptors;
|
||||
|
@ -247,6 +247,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort ()
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort1 ()
|
||||
{
|
||||
PropertyDescriptorCollection descriptors;
|
||||
@ -288,6 +291,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (String [])
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort2 ()
|
||||
{
|
||||
PropertyDescriptorCollection descriptors;
|
||||
@ -345,6 +351,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (IComparer)
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort3 ()
|
||||
{
|
||||
PropertyDescriptorCollection descriptors;
|
||||
@ -402,6 +411,9 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test] // Sort (String [], IComparer)
|
||||
#if WASM
|
||||
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
|
||||
#endif
|
||||
public void Sort4 ()
|
||||
{
|
||||
PropertyDescriptorCollection descriptors;
|
||||
|
@ -40,7 +40,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Credentials_Default ()
|
||||
@ -49,7 +49,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void DeliveryMethod ()
|
||||
@ -67,7 +67,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void EnableSsl ()
|
||||
@ -80,7 +80,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Host ()
|
||||
@ -99,7 +99,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Host_Value_Null ()
|
||||
@ -116,7 +116,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Host_Value_Empty ()
|
||||
@ -134,7 +134,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void PickupDirectoryLocation ()
|
||||
@ -153,7 +153,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Port ()
|
||||
@ -166,7 +166,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Port_Value_Invalid ()
|
||||
@ -195,7 +195,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_Message_Null ()
|
||||
@ -212,7 +212,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_Network_Host_Null ()
|
||||
@ -230,7 +230,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_Network_Host_Whitespace ()
|
||||
@ -249,7 +249,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory ()
|
||||
@ -265,7 +265,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_DirectoryNotFound ()
|
||||
@ -295,7 +295,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Empty ()
|
||||
@ -317,7 +317,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_IllegalChars ()
|
||||
@ -345,7 +345,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_NotAbsolute ()
|
||||
@ -367,7 +367,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Null ()
|
||||
@ -388,7 +388,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void Timeout ()
|
||||
@ -401,7 +401,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#else
|
||||
[ExpectedException (typeof (ArgumentOutOfRangeException))]
|
||||
@ -412,7 +412,7 @@ namespace MonoTests.System.Net.Mail
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if FEATURE_NO_BSD_SOCKETS
|
||||
#if FEATURE_NO_BSD_SOCKETS && !WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void UseDefaultCredentials_Default ()
|
||||
|
@ -19,6 +19,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
public class IPInterfacePropertiesTest
|
||||
{
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void AtLeastOneUnicastAddress ()
|
||||
{
|
||||
int numUnicastAddresses = 0;
|
||||
@ -112,10 +115,13 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void DnsEnabled ()
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
Assert.Ignore ("IsDnsEnabled is not nessasarily enabled for all interfaces on windows.");
|
||||
Assert.Ignore ("IsDnsEnabled is not necessarily enabled for all interfaces on windows.");
|
||||
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
foreach (NetworkInterface adapter in adapters)
|
||||
@ -126,6 +132,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
// The code works as expected when part of a regular app. It fails when executed from within an NUnit test
|
||||
// Might be a problem with the test suite. To investigate.
|
||||
[Category("AndroidNotWorking")]
|
||||
|
@ -19,18 +19,27 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
public class NetworkInterfaceTest
|
||||
{
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void IsNetworkAvailable ()
|
||||
{
|
||||
Assert.IsTrue (NetworkInterface.GetIsNetworkAvailable ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void LoopbackInterfaceIndex ()
|
||||
{
|
||||
Assert.IsTrue (NetworkInterface.LoopbackInterfaceIndex > 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void AtLeastOneInterface ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
@ -38,6 +47,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void FirstInterfaceId ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
@ -45,6 +57,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void FirstInterfaceName ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
@ -52,6 +67,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void FirstInterfaceType ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
@ -59,6 +77,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void FirstInterfaceOperationalStatus ()
|
||||
{
|
||||
var adapter = NetworkInterface.GetAllNetworkInterfaces ()[0];
|
||||
@ -68,6 +89,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void FirstInterfaceSpeed ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
@ -75,6 +99,9 @@ namespace MonoTests.System.Net.NetworkInformation
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if WASM
|
||||
[ExpectedException (typeof (PlatformNotSupportedException))]
|
||||
#endif
|
||||
public void IPv4Mask ()
|
||||
{
|
||||
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user