C
int closesocket( SOCKET s );
Description
The closesocket function closes an existing socket. This function releases the socket descriptor s. Any data buffered at the socket is discarded. If the socket s is no longer needed, closesocket() must be called in order to release all resources associated with s.
Preconditions
None.
Parameters
Parameters |
Description |
s |
Socket descriptor returned from a previous call to socket |
Returns
If closesocket is successful, a value of 0 is returned. A return value of SOCKET_ERROR (-1) indicates an error.
Remarks
None.