Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Add reuse flag #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add reuse flag
Let's say, for example: without of this flag it's can't start asyncwebserver on 80 port after wifimanager(also on 80) is shutdowned. But wifimanager still may be started, because in "WiFiServer.cpp" of ESP8266WiFi lib it's creates tcp_pcb with "SOF_REUSEADDR" flag.
Marisa-Chan authored Jun 6, 2022
commit c2faecc3f7cc219993638d6427d33e28681b78b2
3 changes: 3 additions & 0 deletions src/ESPAsyncTCP.cpp
Original file line number Diff line number Diff line change
@@ -1116,6 +1116,9 @@ void AsyncServer::begin(){
if (!pcb){
return;
}

// Reuse freed socket.
pcb->so_options |= SOF_REUSEADDR;

tcp_setprio(pcb, TCP_PRIO_MIN);
ip_addr_t local_addr;