Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Synchronous close function, releases all the socket assigned resources.

Functions

NMI_API sint8 close (SOCKET sock)
 Synchronous close function, releases all the socket assigned resources. More...
 

NMI_API sint8 close ( SOCKET  sock)

Synchronous close function, releases all the socket assigned resources.

Parameters
[in]sockSocket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
Precondition
Sockets must be initialized through the call of the socketInit function. close is called only for valid socket identifiers created through the socket function.
Warning
If close is called while there are still pending messages (sent or received ) they will be discarded.
See Also
socketInit, socket
Returns
The function returned SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.
Parameters
[in]sockSocket ID, must hold a non negative value. A negative value will return a socket error SOCK_ERR_INVALID_ARG. Indicating that an invalid argument is passed in.
Precondition
Sockets must be initialized through the call of the socketInit function. close is called only for valid socket identifiers created through the socket function.
Warning
If close is called while there are still pending messages (sent or received ) they will be discarded.
See Also
socketInit socket
Returns
The function returned SOCK_ERR_NO_ERROR for successful operation and a negative value (indicating the error) otherwise.

References M2M_INFO, m2m_memset(), MAX_SOCKET, NULL, tstrCloseCmd::sock, SOCK_ERR_INVALID, SOCK_ERR_INVALID_ARG, SOCK_ERR_NO_ERROR, SOCKET_CMD_CLOSE, SOCKET_CMD_SSL_CLOSE, SOCKET_REQUEST, SSL_FLAGS_ACTIVE, tstrCloseCmd::u16SessionID, and tstrSocket::u16SessionID.

Referenced by _http_client_clear_conn(), AppServerCb(), close_socket(), connect_cmd_handler(), connect_to_server(), ConnectNetwork(), disconnect_cmd_handler(), GROWL_APPSocketEventHandler(), handle_tcp_socket_cb(), handle_tcpip_connect(), handle_tcpip_recv(), iot_tls_connect(), iot_tls_disconnect(), IperfSocketClose(), main(), NMI_GrowldeInit(), run_sample_test_app(), setup_android_sockets(), smtpConnect(), socket_cb(), sslConnect(), wifi_ap_provision(), wifi_cb(), and WINC1500_disconnect().