System.Net.Sockets.SafeSocketHandle.UnRegisterForBlockingSyscall C# (CSharp) Method

UnRegisterForBlockingSyscall() public method

public UnRegisterForBlockingSyscall ( ) : void
return void
		public void UnRegisterForBlockingSyscall ()
		{
			//If this NRE, we're in deep problems because Register Must have
			lock (blocking_threads) {
				var current = Thread.CurrentThread;
				blocking_threads.Remove (current);
				if (THROW_ON_ABORT_RETRIES) {
					if (blocking_threads.IndexOf (current) == -1)
						threads_stacktraces.Remove (current);
				}

				if (in_cleanup && blocking_threads.Count == 0)
					Monitor.Pulse (blocking_threads);
			}
		}
	}

Usage Example

Example #1
0
		static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
		{
			try {
				safeHandle.RegisterForBlockingSyscall ();
				return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
			} finally {
				safeHandle.UnRegisterForBlockingSyscall ();
			}
		}
All Usage Examples Of System.Net.Sockets.SafeSocketHandle::UnRegisterForBlockingSyscall