lwip_close
---lwip_netconn_do_join_leave_group
---netconn_prepare_delete
------lwip_netconn_do_delconn
---------lwip_netconn_do_close_internal
tcp_close(tpcb) or tcp_shutdown(tpcb, shut_rx, shut_tx)
tcp_input
tcp_process
case FIN_WAIT_1:
tcp_close
tcp_close_shutdown
tcp_rst
tcp_free
tcp_close_shutdown_fin
tcp_shutdown
tcp_close_shutdown
lwip_netconn_do_close
---tcp_shutdown
---lwip_netconn_do_close_internal
------tcp_close or tcp_shutdown,config null
lwip_shutdown
---netconn_shutdown
netconn_close
---netconn_close_shutdown
------netconn_close_shutdown
netconn_shutdown
---netconn_close_shutdown
------netconn_close_shutdown
netconn_close_shutdown
--netconn_apimsg(lwip_netconn_do_close, &API_MSG_VAR_REF(msg));
---lwip_netconn_do_close_internal
tcp_abort(tpcb);
tpcb = NULL;
{
err = tcp_close(tpcb);
tcp_set_flags(pcb, TF_RXCLOSED);
err = tcp_close(tpcb);
err = tcp_shutdown(tpcb, shut_rx, shut_tx);
tcp_abort(tpcb);
err = ERR_OK;
/* Set back some callback pointers */
if (shut_close) {
tcp_arg(tpcb, NULL);
}
if (tpcb->state == LISTEN) {
tcp_accept(tpcb, NULL);
} else {
/* some callbacks have to be reset if tcp_close is not successful */
if (shut_rx) {
tcp_recv(tpcb, NULL);
tcp_accept(tpcb, NULL);
}
if (shut_tx) {
tcp_sent(tpcb, NULL);
}
if (shut_close) {
tcp_poll(tpcb, NULL, 0);
tcp_err(tpcb, NULL);
}