diff options
author | Simon Rettberg | 2017-12-01 17:12:52 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-12-01 17:12:52 +0100 |
commit | edb818aa42c9bb2e9c5ae437a16aa5f168c0c1a7 (patch) | |
tree | d5b2cd33e79a49f4a90ea608abf8cb789dd1091c /src/client/net/serverdiscovery.cpp | |
parent | [client] Use polling when checking whether to hide the bar (diff) | |
download | pvs2-edb818aa42c9bb2e9c5ae437a16aa5f168c0c1a7.tar.gz pvs2-edb818aa42c9bb2e9c5ae437a16aa5f168c0c1a7.tar.xz pvs2-edb818aa42c9bb2e9c5ae437a16aa5f168c0c1a7.zip |
Fix connection problems qith Qt5 (again)
Diffstat (limited to 'src/client/net/serverdiscovery.cpp')
-rw-r--r-- | src/client/net/serverdiscovery.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/net/serverdiscovery.cpp b/src/client/net/serverdiscovery.cpp index 5ca0eba..33ddbf5 100644 --- a/src/client/net/serverdiscovery.cpp +++ b/src/client/net/serverdiscovery.cpp @@ -21,8 +21,8 @@ ServerDiscovery::ServerDiscovery(QObject *parent) /* Try to get a UDP port for server discovery */ int tries = 10; while (tries-- != 0) { - const quint16 port = (quint16)(qrand() % 10000 + 10000); - if (_discoverySocket.bind(QHostAddress::Any, port)) + quint16 port = (quint16)(16384 + qrand() % 32768); + if (_discoverySocket.bind(QHostAddress::AnyIPv4, port)) break; if (tries == 0) qFatal("Could not bind to any UDP port for server discovery."); |