mirror of
https://gitlab.com/comunic/comunicwatcher
synced 2024-11-22 05:19:25 +00:00
Ready to process WebSocket messages
This commit is contained in:
parent
9394e6b153
commit
ff955398b9
@ -8,6 +8,7 @@ WsClient::WsClient(QObject *parent) : QObject(parent)
|
||||
{
|
||||
connect(&mWebSocket, &QWebSocket::connected, this, &WsClient::onConnected);
|
||||
connect(&mWebSocket, &QWebSocket::disconnected, this, &WsClient::onConnectionError);
|
||||
connect(&mWebSocket, &QWebSocket::textMessageReceived, this, &WsClient::onMessage);
|
||||
|
||||
startConnect();
|
||||
}
|
||||
@ -45,3 +46,8 @@ void WsClient::onConnected()
|
||||
{
|
||||
qDebug() << "Connected to WebSocket";
|
||||
}
|
||||
|
||||
void WsClient::onMessage(const QString &msg)
|
||||
{
|
||||
qDebug() << "WS message: " << msg;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ private slots:
|
||||
void onConnectionError();
|
||||
void getTokenCallBack(APIResponse res);
|
||||
void onConnected();
|
||||
void onMessage(const QString &msg);
|
||||
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user