From b548abc97c99a7d3f50639b0148fdefebf3f57ab Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 6 Aug 2019 20:11:14 +0200 Subject: [PATCH] fix ESPAsyncWebServer/issues/265 in AsyncTCP as well --- src/AsyncTCP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 453fa82..c8aad50 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1246,7 +1246,9 @@ void AsyncServer::end(){ if(_pcb){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); - _tcp_abort(_pcb, NULL); + if(tcp_close(_pcb) != ERR_OK){ + _tcp_abort(_pcb, NULL); + } _pcb = NULL; } }