Then you have to set some time out value for http command.
I dont know how to do that with QHttp. But QTCPSocket is great way to do that.
And you can do all things with QTcpSocket, whatever you can do with QHttp. Because ultimately the socket is in charge of everything.
Example:
sock.connectToHost(host,80);
if(!sock.waitForConnected()) // HERE YOU CAN SET THE TIME OUT VALUE
{
errorString = sock.errorString();
return false;
}
QTcpSocket sock;
sock.connectToHost(host,80);
if(!sock.waitForConnected()) // HERE YOU CAN SET THE TIME OUT VALUE
{
errorString = sock.errorString();
return false;
}
To copy to clipboard, switch view to plain text mode
Bookmarks