Results 1 to 2 of 2

Thread: QUdpSocket::writeDatagram claims to send but does not

  1. #1
    Join Date
    Jun 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QUdpSocket::writeDatagram claims to send but does not

    Hello everyone,
    I have a strange problem with my QUdpSocket. It is used inside a QThread for both sending and receiving of datagrams.
    Most of the time this works. But there are situations when writeDatagrams does return the correct number of bytes sent but no datagram is recorded with Wireshark and no response is received. The network is a simple test network with two clients only one being a Windows machine the other an embedded device.
    errorString() returns "Unknown error". I am really puzzled by the fact that no outgoing data is recorded by Wireshark.
    At first I assumed an error on my side because this behaviour is related to one special datagram. But this datagram differs from the ones sent before only by one byte. And writeDatagram() is called.

    Any hints on what might go wrong here?

    Regards,
    Oliver

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QUdpSocket::writeDatagram claims to send but does not

    Well, UDP is meant to provide an unreliable service where datagrams may arrive out of order or go missing without notice. Typically its used by time sensitive services such as video and audio when you can't afford to be waiting around for packets and prefer to just miss frames out.

    The QOS on a modern OS may even decide to not put such packets on the network, depending on network/system load.

    If you require a reliable service, you should use TCP.

Similar Threads

  1. qudpsocket and localhost
    By ih8veggies in forum Newbie
    Replies: 1
    Last Post: 18th February 2011, 14:54
  2. Replies: 2
    Last Post: 16th April 2009, 06:34
  3. UDP - QUdpSocket
    By denwelzie in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2008, 10:02
  4. QUdpSocket binding
    By db in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2008, 12:24
  5. QUdpSocket and ShareAddress
    By mdecandia in forum Qt Programming
    Replies: 5
    Last Post: 26th March 2007, 18:06

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.