mirror of
				https://gitlab.com/comunic/comunicwatcher
				synced 2025-11-04 12:14:06 +00:00 
			
		
		
		
	Ready to process WebSocket messages
This commit is contained in:
		@@ -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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user