try to recconect pushover frontend
This commit is contained in:
parent
e246656cb1
commit
889eab6f38
|
@ -144,6 +144,7 @@ void PushoverFrontend::connectToService()
|
||||||
snoreDebug(SNORE_WARNING) << "not logged in";
|
snoreDebug(SNORE_WARNING) << "not logged in";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
snoreDebug(SNORE_DEBUG) << "Connecting ton service";
|
||||||
m_socket = new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this);
|
m_socket = new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this);
|
||||||
|
|
||||||
connect(m_socket, &QWebSocket::binaryMessageReceived, [&](const QByteArray & msg) {
|
connect(m_socket, &QWebSocket::binaryMessageReceived, [&](const QByteArray & msg) {
|
||||||
|
@ -172,8 +173,9 @@ void PushoverFrontend::connectToService()
|
||||||
snoreDebug(SNORE_WARNING) << "unknown message recieved" << msg;
|
snoreDebug(SNORE_WARNING) << "unknown message recieved" << msg;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(m_socket, &QWebSocket::disconnected, []() {
|
connect(m_socket, &QWebSocket::disconnected, [this]() {
|
||||||
snoreDebug(SNORE_DEBUG) << "disconnected";
|
snoreDebug(SNORE_WARNING) << "disconnected";
|
||||||
|
QTimer::singleShot(500, this, &PushoverFrontend::connectToService);
|
||||||
});
|
});
|
||||||
connect(m_socket, static_cast<void (QWebSocket::*)(QAbstractSocket::SocketError)>(&QWebSocket::error), [&](QAbstractSocket::SocketError error) {
|
connect(m_socket, static_cast<void (QWebSocket::*)(QAbstractSocket::SocketError)>(&QWebSocket::error), [&](QAbstractSocket::SocketError error) {
|
||||||
snoreDebug(SNORE_WARNING) << error << m_socket->errorString();
|
snoreDebug(SNORE_WARNING) << error << m_socket->errorString();
|
||||||
|
|
Loading…
Reference in New Issue