Search code examples
qtnetwork-programmingqnetworkaccessmanager

QNetworkAccessManager reliable connection in QT


I'm trying to use post and get methods to communicate with remote server in QT client application.After creating connection using QNetworkAccessManager, how can i guarantee that whether my connection is alive or closed?


Solution

  • You can use QNetworkReply::error() after sending request. If no error occured than this function returns QNetworkReply::NoError