increase NodeList send buffer size by default to 128KB

This commit is contained in:
Stephen Birarda 2014-03-25 17:18:45 -07:00
parent 34634af975
commit db757e9e7b

View file

@ -83,6 +83,17 @@ NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
// clear our NodeList when logout is requested
connect(&AccountManager::getInstance(), &AccountManager::logoutComplete , this, &NodeList::reset);
// change the socket send buffer size to be 128KB
const int LARGER_SNDBUF_SIZE = 131072;
setsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, &LARGER_SNDBUF_SIZE, sizeof(LARGER_SNDBUF_SIZE));
int newBufferSize = 0;
unsigned int sizeOfInt = sizeof(newBufferSize);
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, &newBufferSize, &sizeOfInt);
qDebug() << "Changed socket send buffer size to" << newBufferSize << "bytes";
_packetStatTimer.start();
}