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);
    }

}
Exemple #2
0
void AutoTransport::onMessageSent(QSharedPointer<SignalException> ex, quint64 messageId)
{
    Q_EMIT onMessageSentCompleted(ex, messageId);
}