mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:38:27 +02:00
don't change DF or buffer sizes for ice-server
This commit is contained in:
parent
1bbf0179dd
commit
b753871fc1
3 changed files with 17 additions and 11 deletions
|
@ -30,7 +30,7 @@ const int PEER_SILENCE_THRESHOLD_MSECS = 5 * 1000;
|
||||||
IceServer::IceServer(int argc, char* argv[]) :
|
IceServer::IceServer(int argc, char* argv[]) :
|
||||||
QCoreApplication(argc, argv),
|
QCoreApplication(argc, argv),
|
||||||
_id(QUuid::createUuid()),
|
_id(QUuid::createUuid()),
|
||||||
_serverSocket(),
|
_serverSocket(0, false),
|
||||||
_activePeers()
|
_activePeers()
|
||||||
{
|
{
|
||||||
// start the ice-server socket
|
// start the ice-server socket
|
||||||
|
|
|
@ -29,9 +29,10 @@
|
||||||
|
|
||||||
using namespace udt;
|
using namespace udt;
|
||||||
|
|
||||||
Socket::Socket(QObject* parent) :
|
Socket::Socket(QObject* parent, bool shouldChangeSocketOptions) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
_synTimer(new QTimer(this))
|
_synTimer(new QTimer(this)),
|
||||||
|
_shouldChangeSocketOptions(shouldChangeSocketOptions)
|
||||||
{
|
{
|
||||||
connect(&_udpSocket, &QUdpSocket::readyRead, this, &Socket::readPendingDatagrams);
|
connect(&_udpSocket, &QUdpSocket::readyRead, this, &Socket::readPendingDatagrams);
|
||||||
|
|
||||||
|
@ -49,6 +50,8 @@ Socket::Socket(QObject* parent) :
|
||||||
|
|
||||||
void Socket::bind(const QHostAddress& address, quint16 port) {
|
void Socket::bind(const QHostAddress& address, quint16 port) {
|
||||||
_udpSocket.bind(address, port);
|
_udpSocket.bind(address, port);
|
||||||
|
|
||||||
|
if (_shouldChangeSocketOptions) {
|
||||||
setSystemBufferSizes();
|
setSystemBufferSizes();
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
|
@ -61,6 +64,7 @@ void Socket::bind(const QHostAddress& address, quint16 port) {
|
||||||
setsockopt(sd, IPPROTO_IP, IP_DONTFRAGMENT, &val, sizeof(val));
|
setsockopt(sd, IPPROTO_IP, IP_DONTFRAGMENT, &val, sizeof(val));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Socket::rebind() {
|
void Socket::rebind() {
|
||||||
rebind(_udpSocket.localPort());
|
rebind(_udpSocket.localPort());
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Socket : public QObject {
|
||||||
public:
|
public:
|
||||||
using StatsVector = std::vector<std::pair<HifiSockAddr, ConnectionStats::Stats>>;
|
using StatsVector = std::vector<std::pair<HifiSockAddr, ConnectionStats::Stats>>;
|
||||||
|
|
||||||
Socket(QObject* object = 0);
|
Socket(QObject* object = 0, bool shouldChangeSocketOptions = true);
|
||||||
|
|
||||||
quint16 localPort() const { return _udpSocket.localPort(); }
|
quint16 localPort() const { return _udpSocket.localPort(); }
|
||||||
|
|
||||||
|
@ -140,6 +140,8 @@ private:
|
||||||
|
|
||||||
std::unique_ptr<CongestionControlVirtualFactory> _ccFactory { new CongestionControlFactory<TCPVegasCC>() };
|
std::unique_ptr<CongestionControlVirtualFactory> _ccFactory { new CongestionControlFactory<TCPVegasCC>() };
|
||||||
|
|
||||||
|
bool _shouldChangeSocketOptions { true };
|
||||||
|
|
||||||
friend UDTTest;
|
friend UDTTest;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue