Problems when listening with two QUdpSockets
I am trying to use QUdpSockets in my application, but I have a problem I
don't understand at all. I am working with pyQt4 but I think it will be
the same problem in C++.
I create a QDialog with an attribute QUdpSocket and It works well I bind
this socket and I can listen messages.Here the code wich is the same of
the documentation of Qt :
http://harmattan-dev.nokia.com/docs/library/html/qt4/qudpsocket.html
self.udpSocket.bind(QHostAddress("125.10.20.30"),2000)
QObject.connect.(self.udpSocket,SIGNAL("readyRead()"),self.readPendingDatagrams)
But when I create a second QDialog which will listen of an other port
'2001' while the first QDialog is still listening on port '2000' for
example :
When I send messages to this port 2001 the first QDialog stop listening on
port 2000 and all the messages send to port 2000 are redirect on port 2001
I tried all the BindMode possible proponed by the documentation but
nothing changed.
Do you have any ideas ?
Thank you very much
No comments:
Post a Comment