Platform SDK: Windows Sockets

WPUCloseSocketHandle

The WPUCloseSocketHandle function closes an existing socket handle.

int WPUCloseSocketHandle (
  SOCKET    s,      
  LPINT     lpErrno  
);

Parameters

s
[in] Handle to socket created with WPUCreateSocketHandle.
lpErrno
[out] Pointer to the error code.

Return Values

If no error occurs, WPUCreateSocketHandle returns zero. Otherwise, it returns SOCKET_ERROR, and a specific error code is available in lpErrno.

Remarks

The WPUCloseSocketHandle function closes an existing socket handle created by WPUCreateSocketHandle. This function removes the socket from Ws2_32.dll's internal socket table. The owning service provider is responsible for releasing any resources associated with the socket.

Error Codes

Error code Meaning
WSAENOTSOCK Descriptor is not a socket created by WPUCreateSocketHandle.

Requirements

  Version: Requires Windows Sockets 2.0.
  Header: Declared in Ws2spi.h.

See Also

WPUCreateSocketHandle