This is useful on WatchOS and TvOS as it's the only two platforms that
do not support signal based syscall abort. By calling shutdown, the
blocking syscalls on other threads will be interrupted. All the other
platforms currently support signals, so this will not change anything.
We cannot call Close, as this would let the OS reuse the FD for
something else, and the call to Receive (for example) on another thread
could fail with ENOTSOCK.
Unfortunatly it does not work for UDP based connection, as they are not
stream based, so Shutdown does not have much sense.
int error = 0;
Socket.Blocking_internal (handle, false, out error);
+ Socket.Shutdown_internal (handle, SocketShutdown.Both, out error);
if (blocking_threads != null) {
int abort_attempts = 0;
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
+ internal extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
#endregion