1.2.3.1.20 TCPIP_TCP_Disconnect Function

C

bool TCPIP_TCP_Disconnect(
    TCP_SOCKET hTCP
);

Description

This function closes the TX side of a connection by sending a FIN (if currently connected) to the remote node of the connection.

If the socket has the linger option set (default), the queued TX data transmission will be attempted before sending the FIN. If the linger option is off, the queued TX data will be discarded.

Please note that this call may fail in which case it can be re-issued.

Preconditions

TCP socket should have been opened with TCPIP_TCP_ServerOpen()/TCPIP_TCP_ClientOpen(). hTCP - valid socket.

Parameters

ParametersDescription
hTCPHandle to the socket to disconnect.

Returns

  • True - If the call succeeded.

  • False - Indicates that the notification could not be sent to the remote host. The call can be reissued at a later time if desired.

Remarks

None.