diff --git a/ixwebsocket/IXWebSocket.cpp b/ixwebsocket/IXWebSocket.cpp index 0449e694..1146e00d 100644 --- a/ixwebsocket/IXWebSocket.cpp +++ b/ixwebsocket/IXWebSocket.cpp @@ -458,6 +458,11 @@ namespace ix _automaticReconnection = false; } + bool WebSocket::isAutomaticReconnectionEnabled() const + { + return _automaticReconnection; + } + size_t WebSocket::bufferedAmount() const { return _ws.bufferedAmount(); diff --git a/ixwebsocket/IXWebSocket.h b/ixwebsocket/IXWebSocket.h index 283b9e16..59e649d6 100644 --- a/ixwebsocket/IXWebSocket.h +++ b/ixwebsocket/IXWebSocket.h @@ -134,6 +134,7 @@ namespace ix void enableAutomaticReconnection(); void disableAutomaticReconnection(); + bool isAutomaticReconnectionEnabled() const; private: diff --git a/test/IXWebSocketTestConnectionDisconnection.cpp b/test/IXWebSocketTestConnectionDisconnection.cpp index 974f9de0..d06c30c2 100644 --- a/test/IXWebSocketTestConnectionDisconnection.cpp +++ b/test/IXWebSocketTestConnectionDisconnection.cpp @@ -96,6 +96,12 @@ namespace } }); + _webSocket.enableAutomaticReconnection(); + REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == true); + + _webSocket.disableAutomaticReconnection(); + REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == false); + // Start the connection _webSocket.start(); }