[Interest] problem receiving data from QTcpSocket

sarvesh saran aquarian.thunder at gmail.com
Wed Nov 2 13:40:40 CET 2011


Hi!

I am writing a really simple test application that has to connect to a
remote server, send some data and read the reply back.

I've created a QTcpSocket, and then used the connectToHost() call to
connect to the server.

The connection is successful and I get the connected() signal.

Now, when I write data to the server, I never really get a reply (even
though the write was successful). I don't get an error either.

However I do get a reply if I connect and send the data to the server
through Putty! So I am not sure what I am doing wrong.

The code is really simple:

sock->connectToHost("<some_host>.com",114,QIODevice::ReadWrite);

and then in the slot ( slot is for the connected() signal):

int w = sock->write(
"b_action=check;b_version=something;b_device=TestDevice\n");

At this point I keep waiting for the readyRead() signal which never comes.
However, a Putty session with the remote server works fine and I can see
the servers reply.

How do I go about debugging this issue? I am really clueless at this point.
Is there a fault with the server?

thanks,
max.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20111102/6199f283/attachment.html>


More information about the Interest mailing list