TCP: fixes backlog limit handling, and allows ephemeral TCP connections by d-a-v · Pull Request #7096 · esp8266/Arduino · GitHub
Skip to content

TCP: fixes backlog limit handling, and allows ephemeral TCP connections#7096

Merged
d-a-v merged 4 commits into
esp8266:masterfrom
d-a-v:FixBacklogHonorEphemeral
Feb 24, 2020
Merged

TCP: fixes backlog limit handling, and allows ephemeral TCP connections#7096
d-a-v merged 4 commits into
esp8266:masterfrom
d-a-v:FixBacklogHonorEphemeral

Conversation

@d-a-v

@d-a-v d-a-v commented Feb 21, 2020

Copy link
Copy Markdown
Collaborator

When a sketch does not check server::available() often enough, short connections are now received and stored in background (backlog limit number of connections at most) and can be retrieved and used by subsequent client = server::available(). Those clients will be status() == CLOSED, connected() == false but available() > 0.

@kirillandy Could you check this ? I get what's expected by #2569 with these changes.

@JAndrassy This is still not what you are waiting for but it would be nice if you checked nothing has changed on the arduino side (WiFiClient::operator bool() has changed).

fixes #2569

edit:

fixes #7103

@kirillandy

kirillandy commented Feb 22, 2020

Copy link
Copy Markdown

@kirillandy

Copy link
Copy Markdown

UPDATE:
So, if everything I did to get hold of your commit was correct (still need some friendly guidance on that, since this is my first time properly using Git and its commands :)), then everything works like a charm! I repeated my previous experiment by sending a few bytes when the server was not available-looping and the server was able to get the client and read the bytes 👍
I also tried sending bytes in 3 different connections one after the other to check if they'd all be in the queue and the server managed to .available() all 3 and read every message.
Thanks a lot for your work, @d-a-v!

@devyte devyte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jason2866

Copy link
Copy Markdown
Contributor

@d-a-v d-a-v merged commit 2d58be7 into esp8266:master Feb 24, 2020
@d-a-v d-a-v deleted the FixBacklogHonorEphemeral branch February 24, 2020 06:17
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.

PR #6887 generates execptions in Project Tasmota Server closes connection after client shuts down the sending side of its socket

4 participants