Results 1 to 3 of 3

Thread: Distribute bandwidth with QTcpSocket

  1. #1
    Join Date
    Oct 2009
    Posts
    22
    Thanked 1 Time in 1 Post

    Default Distribute bandwidth with QTcpSocket

    I have a small app which sends data to multiple addresses via a QTcpSocket, it uses a timer to distribute the required data between the open sockets which is all great, they send data at an even rate, the problem comes when waiting for a reply from the server, the other sockets all send data at maximum speed starving the incoming socket.

    I could come up with a solution if I knew the available bandwidth but because it's an unknown I'm struggling to think of a good solution, does anyone have any ideas on it?

    Thanks.
    Last edited by danc81; 19th October 2009 at 12:16.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Distribute bandwidth with QTcpSocket

    would dividing the band width to the number of outgoing sockets + 1(incoming) would help?
    It would mean you send less even if not getting anything, but you will be getting at the same rate you are sending, at least in theory...
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2009
    Posts
    22
    Thanked 1 Time in 1 Post

    Default Re: Distribute bandwidth with QTcpSocket

    That's partly the problem, I have no way of knowing the total bandwidth to divide it, if I did then I could just keep some free for the incoming. I suppose I could measure it to see how much is available and divide it that way but it doesn't seem like a "clean" way to do it.

Similar Threads

  1. QTcpSocket proxy authentication problem
    By arbi in forum Qt Programming
    Replies: 3
    Last Post: 14th September 2009, 16:43
  2. Challenging QTcpSocket reliability problem
    By Raccoon29 in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2009, 10:38
  3. array of pointers to QtcpSocket
    By gQt in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th June 2008, 09:15
  4. QTcpSocket and libssh2 ...
    By sandros in forum Qt Programming
    Replies: 6
    Last Post: 21st November 2007, 22:34
  5. Strange QTcpSocket behavior (debugged with Ethereal)
    By mdecandia in forum Qt Programming
    Replies: 23
    Last Post: 28th May 2007, 20:44

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.