PDA

View Full Version : Slow transfer speed for Qt Loopback Networking Example



jmsbc
7th January 2010, 20:09
Hi,

When I run Qt's network Loopback example on a single machine, it will finish 50MB in about 1 or 2 seconds. However when I modify it to run 2 instances on 2 computers (1 server 1 client), the transfer speed drops all the way down to a couple hundred KB per second. Can anyone please tell me why?

Thanks

(For each of the server and client, just need to make modifications to the void Dialog::start() function, setting the server computer to only listen() and the client computer to only connect())

jmsbc
19th January 2010, 18:59
The slow transfer speed problem has been fixed (this problem only occurs on some of the machines that I test on, even though they are identical machines).

The current version of Qt that I'm using 4.5.0 has a hack in their qnativesocketengine_win file that performs socket writing in 49152 byte chunks. For some reason this would cause my machine to write data at slow speeds if I call the write() function with data size greater than 49152. Therefore I am required to write a wrapper around the write() function that breaks up the writes into data sizes less than 49152.

This applies to the loopback example because they specify a const int PAYLOADSIZE of 65KB at the top of the dialog.cpp file. When I change this to any value less than 49152, my transfer speed goes back to normal.