closesocket Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
closesocket Function
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 
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.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.