Results 1 to 1 of 1

Thread: [SOLVED] QTcpSocket with Java Server VERY slow packet transfer

  1. #1
    Join Date
    Nov 2009
    Qt products
    Unix/X11 Windows

    Default [SOLVED] QTcpSocket with Java Server VERY slow packet transfer

    Hi all.

    I'm having a slight issue. I'll send a string through the connection using QTcpSocket::write( const char * ), and it gets to the server ( Which is located on a virtual machine on the same computer as the client ). But when I try to send a message from the Java Server, it takes 30-60 seconds to get the packet on the client side.

    On the client (Qt), the readReady signal that's emitted from my QTcpSocket only emits every 30-60 seconds.

    I have enabled TCP_NODELAY on both the client and the sever, so I'm more or less at a loss for what's wrong.


    Added after 1 16 minutes:

    Okay, I figured out what the problem was. The java Stream writer was holding the text until the buffer was filled. I forced the stream to flush on the server side, and the client received the update. However, there is still a very high latency, that seems to get worse over time.


    Added after 28 minutes:

    Got it!

    The problem was that the server was located on my VM. I moved the server to my other computer, and it worked just fine.
    Last edited by llemes4011; 18th August 2011 at 04:37. Reason: Solved

Similar Threads

  1. QTcpSocket gzip and Transfer chunked
    By giusepped in forum Qt Programming
    Replies: 0
    Last Post: 10th August 2011, 16:41
  2. Packet handling advice with QTcpSocket?
    By zAAm in forum General Programming
    Replies: 1
    Last Post: 27th April 2010, 15:23
  3. Replies: 1
    Last Post: 19th January 2010, 17:59
  4. Packet getting fragmented when sending over QTcpSocket
    By arturo182 in forum Qt Programming
    Replies: 14
    Last Post: 5th August 2009, 23:11
  5. QTcpSocket & transfer errors
    By jkam in forum Qt Programming
    Replies: 1
    Last Post: 20th July 2008, 20:42

Tags for this Thread


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.