PDA

View Full Version : TQ Socket Programming



praveen1
24th August 2012, 08:49
i am receiving large structure in a QT server programme from non-qt client. But it receives only 50176 bytes out of 130024 bytes sent from client. i am using qsocket.read() at qt server. i had tried sending of the struct in slices of 1460 bytes and same size i am receiving at my QT programme. The size of receiving buffer is more than 130024 bytes.
Please help me to resolve this problem.
thanks..

yeye_olive
24th August 2012, 10:24
Without any specific information or code we can only try to guess what is wrong. Besides there is no such thing as "qsocket.read()".

My guess is that you assume that sending a block of n bytes over TCP will result in a single reception of a block of n bytes on the other side. This is not how TCP works (http://nitoprograms.blogspot.fr/2009/04/tcpip-net-sockets-faq.html).