diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index d8c3bc9..0805079 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1252,7 +1252,9 @@ void AsyncServer::end(){ if(_pcb){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); - _tcp_abort(_pcb); + if(tcp_close(_pcb) != ERR_OK){ + _tcp_abort(_pcb); + } _pcb = NULL; } }