Revert to the old, arguably broken code for QT4 port selection, as QT4 doesn't support TCP socket binding as QT5 does.

This commit is contained in:
Dave Page 2017-03-29 11:33:55 -04:00
parent 1d27341e21
commit 87bbb5ef2c

View File

@ -68,8 +68,13 @@ int main(int argc, char * argv[])
// Hence - putting this code in a code block so the scope of the socket
// variable vanishes to make that socket available.
{
#if QT_VERSION >= 0x050000
QTcpSocket socket;
socket.bind(0, QTcpSocket::ShareAddress);
#else
QUdpSocket socket;
socket.bind(0, QUdpSocket::ShareAddress);
#endif
port = socket.localPort();
}