Unsolved [QTcp] Socket/Server check only first if.
-
Hello i have a little problem because i write program to comunicate with server but server always check only first if. What i must to do ?
if(socket->readLine() == "x") { xFunction(); } if(socket->readLine() === "y) { yFunction(): }
-
Hi, the readLine() functions reads ("eats") one line from the server, so try something like this instead:
QString sLine = socket->readLine()->data(); if(sLine == "x") { xFunction(); } if(sLine === "y) { yFunction(): }
-
thanks it working now :)
-
@R4leY so please close this topic as SOLVED. Thanks