add isEnabledAutomaticReconnection (#75)

* add isEnabledAutomaticReconnection

* test isEnabledAutomaticReconnection

* rename
This commit is contained in:
Dimon4eg 2019-05-14 21:26:37 +03:00 committed by Benjamin Sergeant
parent c935be6a49
commit 186c8fbb62
3 changed files with 12 additions and 0 deletions

View File

@ -458,6 +458,11 @@ namespace ix
_automaticReconnection = false;
}
bool WebSocket::isAutomaticReconnectionEnabled() const
{
return _automaticReconnection;
}
size_t WebSocket::bufferedAmount() const
{
return _ws.bufferedAmount();

View File

@ -130,6 +130,7 @@ namespace ix
void enableAutomaticReconnection();
void disableAutomaticReconnection();
bool isAutomaticReconnectionEnabled() const;
private:

View File

@ -96,6 +96,12 @@ namespace
}
});
_webSocket.enableAutomaticReconnection();
REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == true);
_webSocket.disableAutomaticReconnection();
REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == false);
// Start the connection
_webSocket.start();
}