void HttpBasedTransport::onSendHttpResponse(const QString httpResponse, QSharedPointer<SignalException> error) { Q_UNUSED(httpResponse); Q_UNUSED(error); _postTimer.stop(); disconnect(_httpClient, SIGNAL(postRequestCompleted(QString,QSharedPointer<SignalException>)), this, SLOT(onSendHttpResponse(QString,QSharedPointer<SignalException>))); bool timedOut = false, disconnected = false; quint64 messageId = 0; if(error.isNull()) { SignalR::State curState = _connection->getState(); _connection->changeState(curState, SignalR::Connected); QSharedPointer<SignalException> e = TransportHelper::processMessages(_connection, httpResponse, &timedOut, &disconnected, &messageId); if(!e.isNull()) error = e; } tryDequeueNextWorkItem(); if(messageId != 0 || !error.isNull()) Q_EMIT onMessageSentCompleted(error, messageId); else { _connection->emitLogMessage("MessageId 0 received", SignalR::Warning); Q_EMIT onMessageSentCompleted(error, messageId); } }
void HttpBasedTransport::onSendHttpResponse(const QString& httpResponse, SignalException* error) { Q_UNUSED(httpResponse); Q_UNUSED(error); bool timedOut, disconnected; if(!error) { //TODO error handling } TransportHelper::processMessages(_connection, httpResponse, &timedOut, &disconnected); disconnect(_httpClient, SIGNAL(postRequestCompleted(QString,SignalException*)), this, SLOT(onSendHttpResponse(QString,SignalException*))); tryDequeueNextWorkItem(); }
void HttpBasedTransport::retryPost() { tryDequeueNextWorkItem(); }