The tcp_abort function closes the TCP connection
immediately by sending a TCP frame with the RESET flag set to the
remote machine. The argument socket specifies the handle of
the socket whose connection is to be closed.
TCPnet calls the listener callback function only, when a
remote peer has aborted the connection. If the socket aborting is
initiated locally by calling tcp_abort, the callback function
is not called.
The tcp_abort function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
After calling tcp_abort you cannot use the socket to
send or receive any data.
After calling tcp_abort the socket still remains
allocated until you release it.
Return Value
The tcp_abort function returns __TRUE if the connection has
been closed successfully. Otherwise, the function returns
__FALSE.
#include <rtl.h>
void disconnect_tcp (U8 tcp_soc) {
..
/* This TCP connection needs to close immediately */
tcp_abort (tcp_soc);
/* Socket will not be needed anymore */
tcp_release_socket (tcp_soc);
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.