Quote Originally Posted by mcosta View Post
Are you sure you're received bytes you need to readLine()?

Where do you set the code you check?

Qt Code:
  1. s.left(3).toInt()
To copy to clipboard, switch view to plain text mode 
Thanks for your reply.
But I'm not sure I understand what you mean ...
To read what the server says I use this signal/slot:
Qt Code:
  1. connect(tcpSocket, SIGNAL(readyRead()),this,SLOT(readHost()));
To copy to clipboard, switch view to plain text mode 

Every time the server sends a message the readHost() function is called. Here's a piece of code:
Qt Code:
  1. switch(s.left(3).toInt()){
  2. case 100:
  3. t.append("request for help granted");
  4. break;
  5. case 200:
  6. t.append("server ready to receive");
  7. break;
To copy to clipboard, switch view to plain text mode 
I only need the first 3 characters to determine the command it sends, so I strip everything from the message except the first 3 characters.

When I send "From: Vito" nothing happens, that seems normal to me because the string is not terminated by a "\n", but when I add a cr/lf the server responds with a '500' meaning it doesn't understand the message sent.

Maybe I don't use the right commands, that's possible, I got them from an older c-program and that worked fine a while ago on the same newsserver.