Re: What to do in OnDisconnect?
From: Jakob Schröter <js@xxxxxxxxxx>
Date: Wed, 16 Jan 2008 01:57:09 +0100 (CET)
Hi,

On Wednesday January 16 2008, Philippe Roger wrote:
> What can be done in the onDisconnect() handler of a connection listener,
> attached to a gloox client, except terminating the client and creating
> another one?  I don't see how one can reestablish the lost connection, as
> ClientBase::connect() creates a parser, a connection, etc. and finally
> opens the TCP connection.  But since the m_connection data member is
> protected, it is all but impossible to just call connect() again on the
> m_connection object to continue. and in order to call ClientBase::connect()
> again without leaking at least a parser object, the ClientBase destructor
> must be called first.    Am I missing something obvious?

Hm, there are quite some conditionals in the code to prevent leaking. Also, 
there are tests in src/tests/client/client_test.cpp that test re-connection. 
So from what I can tell, it should work and it should not leak. Are you 
seeing any real problems related to re-establishing a connection?

cheers,
Jakob

Attachment: signature.asc
Description: This is a digitally signed message part.