Design |
For example, although Win32 provides a CancelIo function which can be used to cancel outstanding operations, this only works if CancelIo is invoked from the thread that initiated the operation. This restriction was considered too onerous for a portable networking library. Closing the socket will cancel the operation from any thread.