websocket: fix timer interval

This commit is contained in:
tobtoht 2023-01-14 14:55:44 +01:00
parent 1623cfcb4f
commit a6861e458e
2 changed files with 2 additions and 1 deletions

View file

@ -97,6 +97,7 @@ void WebsocketClient::nextWebsocketUrl() {
void WebsocketClient::onConnectionTimeout() {
qWarning() << "Websocket connection timeout";
m_timeout = std::min(m_timeout + 5, 60);
m_connectionTimeout.setInterval(m_timeout*1000);
this->onDisconnected();
}

View file

@ -40,7 +40,7 @@ private:
QUrl m_url;
QTimer m_pingTimer;
QTimer m_connectionTimeout;
int m_timeout = 10;
int m_timeout = 20;
int m_websocketUrlIndex = 0;
bool m_stopped = false;
};