QNetworkReply Error Timeout
-
I'm using a QNetworkAccessManager to create a QNetwork reply via a post.
I then connect the error signal of the QNetworkReply to a slot which I am going to use to handle errors.
The error I am testing for right now is QNetworkReply::TimeoutError.
I start my application and then unplug the ethernet cable. The post is sent and the QNetworkReply is generated but the QNetworkReply::TimoutError is never sent.
Can anyone tell me what I'm doing wrong?
Send the post
@QNetworkReply* reply = m_app->sendRequestList(m_request, m_configPrefs->password().toStdString());
connect(reply, SIGNAL(finished()), this, SLOT(checkReply()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(replyError(QNetworkReply::NetworkError)));@Error Handler
@void XmlPost::replyError(QNetworkReply::NetworkError errorCode)
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
switch(errorCode)
{
case QNetworkReply::TimeoutError:
{
m_requestList.remove(QString::fromStdString(m_request));
reply->deleteLater();
finished();
}
default:
{
break;
}
}
}@