mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 23:27:56 +02:00
cast setsocktopt and getsockopt calls to fix windows build
This commit is contained in:
parent
ed9c805539
commit
c4b8ff8952
2 changed files with 10 additions and 5 deletions
|
@ -83,21 +83,24 @@ 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);
|
||||||
|
|
||||||
|
_packetStatTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NodeList::changeSendSocketBufferSize(int numSendBytes) {
|
||||||
// change the socket send buffer size to be 1MB
|
// change the socket send buffer size to be 1MB
|
||||||
int oldBufferSize = 0;
|
int oldBufferSize = 0;
|
||||||
unsigned int sizeOfInt = sizeof(oldBufferSize);
|
unsigned int sizeOfInt = sizeof(oldBufferSize);
|
||||||
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, &oldBufferSize, &sizeOfInt);
|
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&oldBufferSize), &sizeOfInt);
|
||||||
|
|
||||||
const int LARGER_SNDBUF_SIZE = 1048576;
|
const int LARGER_SNDBUF_SIZE = 1048576;
|
||||||
|
|
||||||
setsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, &LARGER_SNDBUF_SIZE, sizeof(LARGER_SNDBUF_SIZE));
|
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, &newBufferSize, &sizeOfInt);
|
getsockopt(_nodeSocket.socketDescriptor(), SOL_SOCKET, SO_SNDBUF, reinterpret_cast<char*>(&newBufferSize), &sizeOfInt);
|
||||||
|
|
||||||
qDebug() << "Changed socket send buffer size from" << oldBufferSize << "to" << newBufferSize << "bytes";
|
qDebug() << "Changed socket send buffer size from" << oldBufferSize << "to" << newBufferSize << "bytes";
|
||||||
|
|
||||||
_packetStatTimer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
bool NodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
||||||
|
|
|
@ -161,6 +161,8 @@ private:
|
||||||
void requestAuthForDomainServer();
|
void requestAuthForDomainServer();
|
||||||
void activateSocketFromNodeCommunication(const QByteArray& packet, const SharedNodePointer& sendingNode);
|
void activateSocketFromNodeCommunication(const QByteArray& packet, const SharedNodePointer& sendingNode);
|
||||||
void timePingReply(const QByteArray& packet, const SharedNodePointer& sendingNode);
|
void timePingReply(const QByteArray& packet, const SharedNodePointer& sendingNode);
|
||||||
|
|
||||||
|
void changeSendSocketBufferSize(int numSendBytes);
|
||||||
|
|
||||||
NodeHash _nodeHash;
|
NodeHash _nodeHash;
|
||||||
QMutex _nodeHashMutex;
|
QMutex _nodeHashMutex;
|
||||||
|
|
Loading…
Reference in a new issue