Closing Sockets
A version of this page is also available for
4/8/2010
The WSPCloseSocket function releases the socket descriptor so that any pending operations in any threads of the same process will be aborted, and any further reference to it will fail. Note that a reference count should be employed for shared sockets, and only if this is the last reference to an underlying socket, should the information associated with this socket be discarded, provided graceful close is not requested (that is, SO_DONTLINGER is not set). In the case of SO_DONTLINGER being set, any data queued for transmission will be sent, if possible, before information associated with the socket is released. For more information, see WSPCloseSocket.
For non-IFS service providers, WPUCloseSocketHandle must be invoked to release the socket handle back to the Winsock DLL.
Note
The Windows Sockets service provider included in Windows Embedded CE does not support socket sharing. You can, however, create a customized service provider that supports shared sockets.