Results 1 to 10 of 10

Thread: Multicast large data size

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Multicast large data size

    As jefftee said, the readyRead() signal indicates availability of data. It could be emitted for one byte only or several datagrams as one.

    He is also right that fragmentation on any layer below UDP will not show as such on the UDP layer, i.e. no partial datagrams will ever be delivered by the OS.

    Cheers,
    _

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    13
    Thanked 153 Times in 150 Posts

    Default Re: Multicast large data size

    OK, I was curious so I wrote a small multi-cast server and multi-cast client to prove out what I suspected would occur for your use case. The attached code exhibits the behavior I described in a prior post and demonstrates the out of sequence and lost UDP datagrams and confirms that you will never receive partial datagrams that may have been fragmented and one or more fragments are lost.

    Code isn't pretty, but demonstrates how to receive the datagrams and bust them out into individual payloads. The server multi-casts 10,000 datagrams with rotating through an eye catcher of A,B,C,D. The datagrams are random sizes from 512 bytes to 8K in size. I added the eye catcher, a sequence number generated by the server, the length of the payload, and a payload of all binary zeroes.

    You can compare the packet type, sequence, and length from the server to the order received by the client(s).

    Start one or more clients first, then start the server. Give this a try and let me know if you have any questions.

    The project file is attached to this post.
    Attached Files Attached Files
    Last edited by jefftee; 5th May 2015 at 08:53.

  3. #3
    Join Date
    Apr 2015
    Location
    Switzerland
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multicast large data size

    Thx for your input
    I tried your application and found that the package loss was huge and the server failed to send a lot of the packages, I then converted the multicastServer to a QThread so I could use usleep and msleep between packages, and as expected one can improve package loss rates by modulating the sending times.

    Cheers

  4. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    13
    Thanked 153 Times in 150 Posts

    Default Re: Multicast large data size

    I was intentionally blasting packets as quickly as I could to demonstrate the out of sequence and missing packets that can plague UDP. Real world applications will likely have some processing time between sending packets, so it may not be as big of an issue in a real world application, but as you have seen, adding delay between sending the UDP packets will improve reliability significantly.

    Good luck with your application, would love to hear how you make out.

    Later

Similar Threads

  1. Putting large size file on FTP using QNetworkAccessManager
    By darshan.hardas in forum Qt Programming
    Replies: 19
    Last Post: 6th January 2014, 21:45
  2. how to manipulate a very large data using QT?
    By aurora in forum Qt Programming
    Replies: 10
    Last Post: 25th May 2012, 18:37
  3. Qt displays large size jpg
    By omegas in forum Qt Programming
    Replies: 14
    Last Post: 22nd April 2010, 06:07
  4. QWT and large amounts of data
    By ko9 in forum Qwt
    Replies: 1
    Last Post: 17th October 2007, 06:28
  5. QLabel, large, rich text, font size
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2007, 12:56

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
  •  
Qt is a trademark of The Qt Company.