mirror of
https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
synced 2025-10-30 16:15:40 +01:00
Update RX timestamp right after assigning socket
Otherwise the socket poll callback races with the RX timeout (if nonzero) and will immediately disconnect the socket without waiting for it to actually finish connecting.
This commit is contained in:
@@ -496,6 +496,7 @@ bool AsyncClient::connect(IPAddress ip, uint16_t port)
|
||||
xSemaphoreTakeRecursive(_asyncsock_mutex, (TickType_t)portMAX_DELAY);
|
||||
_conn_state = 2;
|
||||
_socket = sockfd;
|
||||
_rx_last_packet = millis();
|
||||
xSemaphoreGiveRecursive(_asyncsock_mutex);
|
||||
|
||||
// Socket is now connecting. Should become writable in asyncTcpSock task
|
||||
|
||||
Reference in New Issue
Block a user