There are three event related to connection state which should be handled:
SocketConnector.ConnectedEvent
Fired when client opens TCP connection to server - XMPP stream is not ready at this point.
SessionEstablishmentModule.SessionEstablishmentSuccessEvent
Fired when client finishes session establishment. It will be called even if SessionEstablishmentModule
is not registered.
SocketConnector.DisconnectedEvent
Fired when TCP connection is closed or when XMPP stream is closed. It will be also called when TCP connection is broken.