mirror of
https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
synced 2025-10-30 16:15:40 +01:00
Skip onPoll processing until socket is fully connected
Previously there was a risk that an in-progress connection with a valid socket would be selected for polling and its installed onPoll callback invoked before the onConnect event arrives, resulting in potentially undefined behavior. Fixed by use of the standard connected() method.
This commit is contained in:
@@ -898,7 +898,7 @@ void AsyncClient::_sockIsReadable(void)
|
||||
|
||||
void AsyncClient::_sockPoll(void)
|
||||
{
|
||||
if (_socket == -1) return;
|
||||
if (!connected()) return;
|
||||
|
||||
uint32_t now = millis();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user