Exemplo n.º 1
0
DDTSession::DDTSession(const QString server) :
    mErrorText(QString::null), mServer(server), mSocket(NULL)
{
    mSocket = new QLocalSocket(this);

    connect(mSocket,SIGNAL(stateChanged(QLocalSocket::LocalSocketState)),
            this,SIGNAL(statusChanged()));
    connect(mSocket,SIGNAL(error(QLocalSocket::LocalSocketError)),
            this, SLOT(errorHandler(QLocalSocket::LocalSocketError)));
    connect(mSocket,SIGNAL(connected()),
            this, SLOT(completeConnection()));

    mSocket->connectToServer(mServer,QIODevice::ReadWrite);
}
Exemplo n.º 2
0
int Logic::process(void) {
    if (!m_operationPermitted)
        return CYNARA_API_OPERATION_NOT_ALLOWED;

    bool completed;
    while (true) {
        int ret = completeConnection(completed);
        if (!completed)
            return ret;
        if (processOut() && processIn())
            return CYNARA_API_SUCCESS;
        onDisconnected();
        if (!connect())
            return CYNARA_API_SERVICE_NOT_AVAILABLE;
    }
}