Server IP TOS

git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@339 05730e5d-ab1b-0410-a4ac-84af385074fa
This commit is contained in:
Thorvald Natvig 2006-02-14 17:17:33 +00:00
parent 09b5cf3648
commit 9290b59ea3

View File

@ -37,6 +37,14 @@
#include "Connection.h"
#include "Server.h"
#ifdef Q_OS_UNIX
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <errno.h>
#endif
Server *g_sServer;
ServerParams g_sp;
@ -104,6 +112,12 @@ Server::Server() {
if (! qusUdp->bind(g_sp.iPort))
qFatal("Server: UDP Bind failed");
#ifdef Q_OS_UNIX
int val = IPTOS_PREC_FLASHOVERRIDE | IPTOS_LOWDELAY | IPTOS_THROUGHPUT;
if (setsockopt(qusUdp->socketDescriptor(), SOL_IP, IP_TOS, &val, sizeof(val)))
qWarning("Server: Failed to set TOS for UDP Socket");
#endif
connect(qusUdp, SIGNAL(readyRead()), this, SLOT(udpReady()));
log(QString("Server listening on port %1").arg(g_sp.iPort));