我的应用程序中有 1 个QNetworkAccessManager
,我同时发出 2 个请求。当我从经理那里得到回复时,回复不是按照我打电话给他们的顺序,这是有道理的。我该如何解决这个问题?我应该让另一位经理来清除任何请求队列问题吗?
QNetworkRequest request1(ONE_GET);
request1.setRawHeader("Content-Type", "application/vnd.api+json");
request1.setRawHeader("Accept", "application/vnd.api+json");
m_nam.get(request1);
connect(&m_nam, &QNetworkAccessManager::finished,this , &HelperClass::onReply1Recieved);
QNetworkRequest request2(TWO_GET);
request2.setRawHeader("Content-Type", "application/vnd.api+json");
request2.setRawHeader("Accept", "application/vnd.api+json");
m_nam.get(request2);
connect(&m_nam, &QNetworkAccessManager::finished,this , &HelperClass::onReply2Recieved);