fixed issue #50: ensure that tcp_nodelay is set

This commit is contained in:
Max-Wilhelm Bruker 2012-05-09 21:57:06 +02:00
parent b106f76294
commit f7975d8ace
2 changed files with 2 additions and 0 deletions

View file

@ -19,6 +19,7 @@ RemoteClient::RemoteClient(QObject *parent)
connect(timer, SIGNAL(timeout()), this, SLOT(ping()));
socket = new QTcpSocket(this);
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
connect(socket, SIGNAL(connected()), this, SLOT(slotConnected()));
connect(socket, SIGNAL(readyRead()), this, SLOT(readData()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slotSocketError(QAbstractSocket::SocketError)));

View file

@ -44,6 +44,7 @@ void Servatrice_GameServer::incomingConnection(int socketDescriptor)
} else {
QTcpSocket *socket = new QTcpSocket;
socket->setSocketDescriptor(socketDescriptor);
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
ServerSocketInterface *ssi = new ServerSocketInterface(server, socket);
logger->logMessage(QString("incoming connection: %1").arg(socket->peerAddress().toString()), ssi);
}