PDA

View Full Version : Qt4 - UDP Broadcast



guilugi
5th July 2006, 13:48
Hi everyone !

I just implemented the broadcast sender / receiver example that's in the Qt4 docs...but I have a little problem.
The Sender example shows how to broadcast a message, but it doesn't show how to listen to the answers...

What I did:
- I connected the signal readyRead() to a slot readFromSocket(), to process / display everything...and the socket doesn't receive anything, strangely.
- There are clients that receive my broadcast message, and they send an reply message...but it doesn't reach my Qt socket.

Have I done something wrong here, or is there some issue with the QUdpSocket ?

Thanks,
Guilugi.

PS : I attached my sample code!

guilugi
5th July 2006, 14:36
Ok,

Sorry, I was confused with QUdpSocket / QAbstractSocket : I have to use explicitely a UDP socket and UDP commands (writeDatagram / readDatagram), and it works fine.
Strange, though.

Guilugi.