Results 1 to 2 of 2

Thread: Unicast with QUdpSocket

  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Unicast with QUdpSocket

    Can the QUdpSocket class be set up to natively support UDP Unicast communications? I can't seem to find anything in the documentation...or maybe I just don't know what I'm looking for. An example would be great.

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Unicast with QUdpSocket

    Unicast is a one-to one association between the client and the server: that's the normal mode of operation for a socket.

    Use bind() to listen for datagrams, readDatagram() to read received data, and writeDatagram() to send data. It's all in the QUdpSocket page and the linked Broadcast examples (just use a single address rather than the broadcast address).

    Have I missed something in your question?

  3. The following user says thank you to ChrisW67 for this useful post:

    bryang (22nd February 2011)

Similar Threads

  1. qudpsocket and localhost
    By ih8veggies in forum Newbie
    Replies: 1
    Last Post: 18th February 2011, 13:54
  2. Working with QUdpSocket
    By csvivek in forum Qt Programming
    Replies: 6
    Last Post: 30th October 2009, 01:38
  3. QUdpSocket and bytesAvailable
    By babu198649 in forum Newbie
    Replies: 0
    Last Post: 10th December 2008, 10:49
  4. UDP - QUdpSocket
    By denwelzie in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2008, 09:02
  5. QUdpSocket hasPendingDatagrams()
    By mbjerkne in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 19:14

Tags for this Thread

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.