mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
actually attempt to change send buffer size
This commit is contained in:
parent
962c7350f3
commit
6e161e7c61
1 changed files with 5 additions and 4 deletions
|
@ -83,6 +83,9 @@ NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) :
|
||||||
// clear our NodeList when logout is requested
|
// clear our NodeList when logout is requested
|
||||||
connect(&AccountManager::getInstance(), &AccountManager::logoutComplete , this, &NodeList::reset);
|
connect(&AccountManager::getInstance(), &AccountManager::logoutComplete , this, &NodeList::reset);
|
||||||
|
|
||||||
|
const int LARGER_SNDBUF_SIZE = 1048576;
|
||||||
|
changeSendSocketBufferSize(LARGER_SNDBUF_SIZE);
|
||||||
|
|
||||||
_packetStatTimer.start();
|
_packetStatTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,10 +101,8 @@ void NodeList::changeSendSocketBufferSize(int numSendBytes) {
|
||||||
|
|
||||||
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&oldBufferSize), &sizeOfInt);
|
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&oldBufferSize), &sizeOfInt);
|
||||||
|
|
||||||
const int LARGER_SNDBUF_SIZE = 1048576;
|
setsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<const char*>(&numSendBytes),
|
||||||
|
sizeof(numSendBytes));
|
||||||
setsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<const char*>(&LARGER_SNDBUF_SIZE),
|
|
||||||
sizeof(LARGER_SNDBUF_SIZE));
|
|
||||||
|
|
||||||
int newBufferSize = 0;
|
int newBufferSize = 0;
|
||||||
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&newBufferSize), &sizeOfInt);
|
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&newBufferSize), &sizeOfInt);
|
||||||
|
|
Loading…
Reference in a new issue