Allow faster reuse of socket, to be able to restart WifiServer. (#4306)

See #3960 for more details of the problem and the solution. I only implemented what was proposed in this ticket, as it solves my problem, which was the same as in this ticket. Credits for the code going to @etrinh ;-)

This also is a more consistence behaviour compared to esp8266, where it also is possible to restart the wifiserver immediately on the same port.
This commit is contained in:
ahorn42
2020-11-06 13:16:50 +01:00
committed by GitHub
parent dd1a15478f
commit c6a8da61f7
2 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,7 @@ class WiFiServer : public Server {
WiFiClient available();
WiFiClient accept(){return available();}
void begin(uint16_t port=0);
void begin(uint16_t port, int reuse_enable);
void setNoDelay(bool nodelay);
bool getNoDelay();
bool hasClient();