Results 1 to 5 of 5

Thread: QudpSocket: Speed Issue

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

    Default QudpSocket: Speed Issue

    Hi.
    I'm trying to create a connection between two application using QUdpSocket.

    I send many udp packet consequently, for example
    Qt Code:
    1. uiDatawritten = m_pxUdpSocket->writeDatagram(xByteArray.data(), xByteArray.size(), *m_pxHostAddress, UDPPORT);
    2. uiDatawritten2 = m_pxUdpSocket->writeDatagram(xByteArray2.data(), xByteArray2.size(), *m_pxHostAddress, UDPPORT);
    To copy to clipboard, switch view to plain text mode 

    But, when I do it, the second application receives only the last packet, and the first is discarded.

    I'd like to known if it's a known issue, and how I can resolve it, also considering that I can't use TCP and I need to send packets as fast as possible.
    Any help is appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QudpSocket: Speed Issue

    UDP doesn't guarantee to deliver all datagrams and also doesn't guarantee the order in which they are received.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    Default Re: QudpSocket: Speed Issue

    Thanks for your reply. I've tried to use TCP, but I can't change the other application that's not mine...
    There's some test to see what's the minimum time interval that must pass between one packet and the following, to have an high probability that both of them can be received?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QudpSocket: Speed Issue

    There is no such test. Everything depends on the network segments those datagrams are travelling through. Any UDP datagram can be discarded by any router without any explanation. Check if your communication works properly on localhost and just design your protocol in a way that can cope with datagram loss.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QudpSocket: Speed Issue

    Ok I'll find a solution. Thanks for your suggestions.

Similar Threads

  1. QUdpSocket not getting responses
    By mhoover in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2009, 02:40
  2. UDP - QUdpSocket
    By denwelzie in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2008, 10:02
  3. QUdpSocket binding
    By db in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2008, 12:24
  4. QUdpSocket and ShareAddress
    By mdecandia in forum Qt Programming
    Replies: 5
    Last Post: 26th March 2007, 18:06
  5. Rendering rectangles speed issue
    By macbeth in forum Qt Programming
    Replies: 11
    Last Post: 15th March 2007, 02:30

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.