From 44a813caae730863d7867c9a20c453746bee38ae Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Tue, 28 Jan 2020 10:27:30 -0800 Subject: [PATCH] quit checkConnection after sleeping if requested to stop (iterate on #151) --- ixwebsocket/IXWebSocket.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ixwebsocket/IXWebSocket.cpp b/ixwebsocket/IXWebSocket.cpp index cd9b0d78..945e1a09 100644 --- a/ixwebsocket/IXWebSocket.cpp +++ b/ixwebsocket/IXWebSocket.cpp @@ -287,6 +287,11 @@ namespace ix _sleepCondition.wait_for(lock, duration); } + if (_stop) + { + break; + } + // Try to connect synchronously ix::WebSocketInitResult status = connect(_handshakeTimeoutSecs);