mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-14 03:56:20 -05:00
fixed issue #50: ensure that tcp_nodelay is set
This commit is contained in:
@@ -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)));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user