To avoid a startup delay, don't increase cycle read timeout until some work is ready

This commit is contained in:
Ian Craggs 2022-05-26 21:23:23 +01:00
parent f54f10ec10
commit 22690b8881
1 changed files with 2 additions and 1 deletions

View File

@ -1993,10 +1993,11 @@ thread_return_type WINAPI MQTTAsync_receiveThread(void* n)
MQTTAsync_lock_mutex(mqttasync_mutex);
if (MQTTAsync_tostop)
break;
timeout = 1000L;
if (sock == 0)
continue;
timeout = 1000L;
/* find client corresponding to socket */
if (ListFindItem(MQTTAsync_handles, &sock, clientSockCompare) == NULL)
{