Added more instrumentation to socket

p4#: 19224
This commit is contained in:
Magne Sjaastad 2012-10-19 10:05:55 +02:00
parent 8957a92830
commit 0946849a79
2 changed files with 22 additions and 0 deletions

View File

@ -147,6 +147,8 @@ void RiaSocketServer::handleClientConnection(QTcpSocket* clientToHandle)
m_currentPropertyName = "";
connect(m_currentClient, SIGNAL(disconnected()), this, SLOT(slotCurrentClientDisconnected()));
connect(m_currentClient, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slotCurrentClientError(QAbstractSocket::SocketError)));
connect(m_currentClient, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(slotCurrentClientStateChanged(QAbstractSocket::SocketState)));
m_readState = ReadingCommand;
@ -639,3 +641,19 @@ void RiaSocketServer::slotReadyRead()
break;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSocketServer::slotCurrentClientError(QAbstractSocket::SocketError socketError)
{
qDebug() << "slotCurrentClientError() error : " << m_currentClient->errorString();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSocketServer::slotCurrentClientStateChanged(QAbstractSocket::SocketState socketState)
{
qDebug() << "slotCurrentClientStateChanged() state : " << m_currentClient->state();
}

View File

@ -19,6 +19,7 @@
#pragma once
#include <QDialog>
#include <QAbstractSocket>
class QLabel;
class QPushButton;
@ -44,6 +45,9 @@ public:
private slots:
void slotNewClientConnection();
void slotCurrentClientDisconnected();
void slotCurrentClientError(QAbstractSocket::SocketError socketError);
void slotCurrentClientStateChanged(QAbstractSocket::SocketState socketState);
void slotReadyRead();