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
@ -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;
|
||||
|
Reference in New Issue
Block a user