Results 1 to 2 of 2

Thread: Qt4 - UDP Broadcast

  1. #1
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt4 - UDP Broadcast

    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!
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 - UDP Broadcast

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.