Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QXmppClient::connectToServer bad behaviour when bad Host or Port #98

Open
miguelangelorenes opened this issue Apr 26, 2016 · 0 comments

Comments

@miguelangelorenes
Copy link

I am doing an XMPP client based on qxmmp.
According with doucmentations:

Attempts to connect to the XMPP server. Server details and other configurations are specified using the config parameter. Use signals connected(), error(QXmppClient::Error) and disconnected() to know the status of the connection.

But, for some reason I am not getting any of these signals when trying to connect with a bad port or a bad server.
My code is the follow:

//XMPP Login information
    QXmppConfiguration conf;
    conf.setHost(server);
    conf.setPort(port);
    conf.setDomain(domain);
    conf.setUser(node);
    conf.setResource(resource);
    conf.setPassword(password);
    conf.setAutoReconnectionEnabled(false);

    //Connect to every QXMPP signals
    connect(m_qxmmpClient.data(), SIGNAL(connected()), SLOT(onConnected()));
    connect(m_qxmmpClient.data(), SIGNAL(disconnected()), SLOT(onDisconnected()));
    connect(m_qxmmpClient.data(), SIGNAL(loggerChanged(QXmppLogger*)), SLOT(onLoggerChanged(QXmppLogger*)));
    connect(m_qxmmpClient.data(), SIGNAL(messageReceived(QXmppMessage)), SLOT(onMessageReceived(QXmppMessage)));
    connect(m_qxmmpClient.data(), SIGNAL(presenceReceived(QXmppPresence)), SLOT(onPresenceReceived(QXmppPresence)));
    connect(m_qxmmpClient.data(), SIGNAL(iqReceived(QXmppIq)), SLOT(onIqReceived(QXmppIq)));
    connect(m_qxmmpClient.data(), SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSSLErrors(QList<QSslError>)));
    connect(m_qxmmpClient.data(), SIGNAL(stateChanged(QXmppClient::State)), SLOT(onStateChanged(QXmppClient::State)));

    //Connect to XMPP server
    m_qxmmpClient->connectToServer(conf);

By other way, I am getting stateChanged signal with value QXmppClient::DisconnectedState.

I would like to know if I have to manage in my side connection status or I should receive a connect/disconnet/error signal any time I try to connect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant