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

support server.accept() for WiFiNINA library #79

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy commented Jan 7, 2022

A PR in WiFiNINA library follows.

There are almost no comments in the fw source code so I didn't add any too. But it is not too complicated. The only catch is that CommandHandlerClass::updateGpio0Pin periodically calls server.available() which accepts clients for _spawnedSockets (available() and write-to-all clients management). A new function server.hasClient (inspired by the ESP32 core WiFi library's WiFiServer) is used to outrun available() in accepting a new client from updateGpio0Pin. If after IRQ pin is activated, the sketch calls accept(), the pre-accepted client is returned and not used for _spawnedSockets. If available() is called from sketch, then the pre-accepted socket is added to _spawnedSockets.

btw: WiFiServer::available() should be rewritten to only get new clients if there is a slot in _spawnedSockets.

@JAndrassy
Copy link
Contributor Author

@facchinm please why not include this into the prerelease?

@facchinm facchinm merged commit c84aa34 into arduino:master Jun 9, 2022
@facchinm
Copy link
Member

facchinm commented Jun 9, 2022

Hi @JAndrassy ,
I'm going to prerelease this change in 1.5.1 as soon as 1.5.0 has rolled out safely; thanks for your effort!

@xreef
Copy link

xreef commented Dec 3, 2023

Hi @JAndrassy , I'm going to prerelease this change in 1.5.1 as soon as 1.5.0 has rolled out safely; thanks for your effort!

Hi @facchinm,
can you share the precompiled file? Isn't shared anywhere yet.
Thanks

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.

3 participants