FreeRTOS: Secure Sockets
Return to main page ↑
SOCKETS_Close

Closes the socket and frees the related resources.

int32_t SOCKETS_Close( Socket_t xSocket );

A socket should be shutdown gracefully before it is closed, and cannot be used after it has been closed.

See the Berkeley Sockets API in wikipedia

Warning
SOCKETS_Close() is not safe to be called on the same socket from multiple threads simultaneously with SOCKETS_Connect(), SOCKETS_SetSockOpt(), SOCKETS_Shutdown(), SOCKETS_Close().
Parameters
[in]xSocketThe handle of the socket to close.
Returns
  • On success, 0 is returned.
  • If an error occurred, a negative value is returned. SocketsErrors