Skip to content

Commit 6a76efa

Browse files
committed
fix #445 #446 set TCP timeout for ESP32 on connect
1 parent 2944368 commit 6a76efa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/WebSocketsClient.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,11 @@ void WebSocketsClient::loop(void) {
190190
DEBUG_WEBSOCKETS("[WS-Client] creating Network class failed!");
191191
return;
192192
}
193-
193+
#if defined(ESP32)
194+
if(_client.tcp->connect(_host.c_str(), _port, WEBSOCKETS_TCP_TIMEOUT)) {
195+
#else
194196
if(_client.tcp->connect(_host.c_str(), _port)) {
197+
#endif
195198
connectedCb();
196199
_lastConnectionFail = 0;
197200
} else {

0 commit comments

Comments
 (0)