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

XMPP Client Problem -> Sometimes when the Socket is connected, the XMPP session does not Start #119

Open
jpancorb opened this issue Dec 1, 2016 · 0 comments

Comments

@jpancorb
Copy link

jpancorb commented Dec 1, 2016

Hello:

I'm developing a XMPP Client with your library to connect it with a XMPP OpenFire Server that has a very heavy workload...

I known that when your Client is connecting with the Server and the socket is connected, your Client wait for the first Stanza from the Server to start the XMPP Session. But sometimes the Client is blocked for a very long time, even for days, without my Server sending the Stanza neither closing the connection.

In this case your Client library there isn't a timeout, and the KeepAlive timer won't begin until this first Stanza start the session

I fixed the problem changing your QXmppOutgoingClient Client class as follows:

QXmppOutgoingClient::QXmppOutgoingClient(QObject *parent)
: QXmppStream(parent),
d(new QXmppOutgoingClientPrivate(this))
{
-----------------------------------------

// Begin KeepAlive when the socket is connected and not when the XMPP session is started ->
// There is a problem: sometimes when the socket is connected, the server does not send the first stanza neither broke the connection
// The process can be blocked for days
//
//    check = connect(this, SIGNAL(connected()),
//                    this, SLOT(pingStart()));
//    Q_ASSERT(check);

}

/// \cond
void QXmppOutgoingClient::handleStart()
{


//JCP *** Begin KeepAlive when the socket is connected and not when the xmpp session is started ->
// There is a problem when the socket is connected and the server does not send the first stanza neither broke the connection

// The process can be blocked for days
info(QString("Patch Start keep alive when socket connected"));
pingStop();
pingStart();
}

Because the handleStart() slot is called when the socket is connected, now I'm starting the keepAlive timer without waiting for the session starting and It has fixed my problem

What do you think about this approach?. Is there any problem for doing that?. Do you have a better approach for this problem?

Thanks in advanced

Regards:

JCP

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