Skip to content
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

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

Merged
merged 4 commits into from
Feb 24, 2020

Conversation

d-a-v
Copy link
Collaborator

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

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
Copy link

kirillandy commented Feb 22, 2020

Hi @d-a-v ! Currently trying to check your changes out, but I'm not too certain about my actions.
So I installed the current ESP Arduino library version using Git (as the docs instruct). After a bit of research I then used "git merge https://github.com/d-a-v/Arduino.git FixBacklogHonorEphemeral" to apply your changes on what I have locally stored on my PC.

Is that all I need to do before I compile my code to test out on my ESPs?
(Also, if my actions were correct, was there an easier way to do what I did? :D)

@kirillandy
Copy link

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!

Copy link
Collaborator

@devyte devyte left a comment

Choose a reason for hiding this comment

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

LGTM

@Jason2866
Copy link
Contributor

Fix #7103

@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
4 participants