Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

ahorn42
Copy link
Contributor

@ahorn42 ahorn42 commented Aug 28, 2020

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.

@me-no-dev
Copy link
Member

this should be optional, though I do not mind it being default

@ahorn42
Copy link
Contributor Author

ahorn42 commented Oct 3, 2020

@me-no-dev what would be your suggestion to make it configurable? Would an additional overload for begin with a flag be an idea?

like:

void WiFiServer::begin(uint16_t port, bool socketReuse)

@everslick
Copy link
Contributor

#1267

@everslick
Copy link
Contributor

void WiFiServer::begin(uint16_t port, bool socketReuse)

how about using the same method, but with default parameter:

void WiFiServer::begin(uint16_t port, bool socketReuse = true)

@me-no-dev
Copy link
Member

i agree with @everslick

@me-no-dev me-no-dev merged commit c6a8da6 into espressif:master Nov 6, 2020
@ahorn42
Copy link
Contributor Author

ahorn42 commented Nov 6, 2020

@me-no-dev thanks for implementing/merging it! - you were faster than me, wanted to do this on the weekend ;D

@marioelectron
Copy link

setTimeout in ESP32 not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants