Unverified Commit 7928f8a5 authored by Ian Craggs's avatar Ian Craggs Committed by GitHub

Merge pull request #380 from ubyyj/fix-reconnect-bug-windows-2

fix issue that MQTTClient_connect hangs on network outage, for windows
parents e81b6755 b3e2930a
......@@ -233,7 +233,7 @@ int Thread_wait_sem(sem_type sem, int timeout)
FUNC_ENTRY;
#if defined(WIN32) || defined(WIN64)
rc = WaitForSingleObject(sem, timeout);
rc = WaitForSingleObject(sem, timeout < 0 ? 0 : timeout);
#elif defined(OSX)
rc = (int)dispatch_semaphore_wait(sem, dispatch_time(DISPATCH_TIME_NOW, (int64_t)timeout*1000000L));
#elif defined(USE_TRYWAIT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment