FreeRTOS: Secure Sockets
Return to main page ↑
SOCKETS_Shutdown

Closes all or part of a full-duplex connection on the socket.

int32_t SOCKETS_Shutdown( Socket_t xSocket,
uint32_t ulHow );

Disable reads and writes on a connected TCP socket. A connected TCP socket must be gracefully shut down before it can be closed.

See the Berkeley Sockets API in wikipedia

Warning
SOCKETS_Shutdown() 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 shutdown.
[in]ulHowSOCKETS_SHUT_RD, SOCKETS_SHUT_WR or SOCKETS_SHUT_RDWR. ShutdownFlags
Returns
  • If the operation was successful, 0 is returned.
  • If an error occurred, a negative value is returned. SocketsErrors