Address connect errors in logs (#4882)
This commit is contained in:
parent
064b362d60
commit
0deb037035
2 changed files with 8 additions and 3 deletions
|
@ -85,7 +85,7 @@ void Servatrice_GameServer::incomingConnection(qintptr socketDescriptor)
|
||||||
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
||||||
|
|
||||||
auto ssi = new TcpServerSocketInterface(server, pool->getDatabaseInterface());
|
auto ssi = new TcpServerSocketInterface(server, pool->getDatabaseInterface());
|
||||||
connect(ssi, SIGNAL(incTxBytes), this, SLOT(incTxBytes));
|
connect(ssi, SIGNAL(incTxBytes(qint64)), this, SLOT(incTxBytes(qint64)));
|
||||||
ssi->moveToThread(pool->thread());
|
ssi->moveToThread(pool->thread());
|
||||||
pool->addClient();
|
pool->addClient();
|
||||||
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
connect(ssi, SIGNAL(destroyed()), pool, SLOT(removeClient()));
|
||||||
|
@ -155,7 +155,7 @@ void Servatrice_WebsocketGameServer::onNewConnection()
|
||||||
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
Servatrice_ConnectionPool *pool = findLeastUsedConnectionPool();
|
||||||
|
|
||||||
auto ssi = new WebsocketServerSocketInterface(server, pool->getDatabaseInterface());
|
auto ssi = new WebsocketServerSocketInterface(server, pool->getDatabaseInterface());
|
||||||
connect(ssi, SIGNAL(incTxBytes), this, SLOT(incTxBytes));
|
connect(ssi, SIGNAL(incTxBytes(quint64)), this, SLOT(incTxBytes(quint64)));
|
||||||
/*
|
/*
|
||||||
* Due to a Qt limitation, websockets can't be moved to another thread.
|
* Due to a Qt limitation, websockets can't be moved to another thread.
|
||||||
* This will hopefully change in Qt6 if QtWebSocket will be integrated in QtNetwork
|
* This will hopefully change in Qt6 if QtWebSocket will be integrated in QtNetwork
|
||||||
|
|
|
@ -1701,9 +1701,14 @@ TcpServerSocketInterface::TcpServerSocketInterface(Servatrice *_server,
|
||||||
socket = new QTcpSocket(this);
|
socket = new QTcpSocket(this);
|
||||||
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
|
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
|
||||||
connect(socket, SIGNAL(readyRead()), this, SLOT(readClient()));
|
connect(socket, SIGNAL(readyRead()), this, SLOT(readClient()));
|
||||||
|
connect(socket, SIGNAL(disconnected()), this, SLOT(catchSocketDisconnected()));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this,
|
||||||
|
SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
||||||
|
#else
|
||||||
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
|
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
|
||||||
SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
||||||
connect(socket, SIGNAL(disconnected()), this, SLOT(catchSocketDisconnected()));
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TcpServerSocketInterface::~TcpServerSocketInterface()
|
TcpServerSocketInterface::~TcpServerSocketInterface()
|
||||||
|
|
Loading…
Reference in a new issue