randomly chosen ports
authordisplacer
Thu, 08 Feb 2007 20:03:03 +0000
changeset 417 bc7fea9abd9c
parent 416 595d8663254d
child 418 595a868918be
randomly chosen ports
QTfrontend/netudpserver.cpp
QTfrontend/netudpwidget.cpp
--- a/QTfrontend/netudpserver.cpp	Thu Feb 08 19:03:23 2007 +0000
+++ b/QTfrontend/netudpserver.cpp	Thu Feb 08 20:03:03 2007 +0000
@@ -25,7 +25,7 @@
     if(QString("%1").arg(datagram.data())==QString("hedgewars client")) {
       // send answer to client
       qDebug() << "received UDP query from " << clientAddr << ":" << clientPort;
-      pUdpSocket->writeDatagram("hedgewars server", clientAddr, 46632);
+      pUdpSocket->writeDatagram("hedgewars server", clientAddr, clientPort);
     }
   }
 }
--- a/QTfrontend/netudpwidget.cpp	Thu Feb 08 19:03:23 2007 +0000
+++ b/QTfrontend/netudpwidget.cpp	Thu Feb 08 20:03:03 2007 +0000
@@ -12,7 +12,7 @@
   mainLayout.addWidget(serversList);
   pUdpSocket = new QUdpSocket(this);
 
-  pUdpSocket->bind(46632, QUdpSocket::ShareAddress);
+  pUdpSocket->bind();
   connect(pUdpSocket, SIGNAL(readyRead()), this, SLOT(onClientRead()));
   updateList();
 }