Closed JAndrassy closed 2 years ago
@facchinm please why not include this into the prerelease?
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 @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
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.