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);
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.