diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f52e1c9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +set(COMPONENT_SRCDIRS + "src" +) + +set(COMPONENT_ADD_INCLUDEDIRS + "src" +) + +set(COMPONENT_REQUIRES + "arduino-esp32" +) + +register_component() + +target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 2d0917b..e11d9aa 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1278,7 +1278,9 @@ void AsyncServer::end(){ if(_pcb){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); - _tcp_abort(_pcb, -1); + if(tcp_close(_pcb) != ERR_OK){ + _tcp_abort(_pcb, -1); + } _pcb = NULL; } }