From d739662a7c245af8ed6b990558c9a151cf4717be Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Mon, 8 Mar 2021 04:23:43 +0100 Subject: [PATCH] Allow customizing the websocket handshake timeout (#264) --- ixwebsocket/IXWebSocket.cpp | 5 +++++ ixwebsocket/IXWebSocket.h | 1 + 2 files changed, 6 insertions(+) diff --git a/ixwebsocket/IXWebSocket.cpp b/ixwebsocket/IXWebSocket.cpp index 0d1cfa01..bfe59564 100644 --- a/ixwebsocket/IXWebSocket.cpp +++ b/ixwebsocket/IXWebSocket.cpp @@ -56,6 +56,11 @@ namespace ix _url = url; } + void WebSocket::setHandshakeTimeout(int handshakeTimeoutSecs) + { + _handshakeTimeoutSecs = handshakeTimeoutSecs; + } + void WebSocket::setExtraHeaders(const WebSocketHttpHeaders& headers) { std::lock_guard lock(_configMutex); diff --git a/ixwebsocket/IXWebSocket.h b/ixwebsocket/IXWebSocket.h index 5c47d303..7779ad14 100644 --- a/ixwebsocket/IXWebSocket.h +++ b/ixwebsocket/IXWebSocket.h @@ -48,6 +48,7 @@ namespace ix void setUrl(const std::string& url); // send extra headers in client handshake request + void setHandshakeTimeout(int handshakeTimeoutSecs); void setExtraHeaders(const WebSocketHttpHeaders& headers); void setPerMessageDeflateOptions( const WebSocketPerMessageDeflateOptions& perMessageDeflateOptions);