Mountain View
Jabber SDK API Documentation

Tutorial: Handle Lost Connection With Add-on

Handle Lost Connection With Add-on

Handle Lost Connection With Add-on Add-on is the core component of the Jabber SDK. CWIC library can be considered as a proxy library because most of the API just passes request down to Add-on, which then executes those request. Also most of the events in CWIC just reflect inner behaviour of Add-on. Since Add-on is such a crucial component, if somehow connection with Add-on is lost or if it isn't present on the system it needs to be tracked. This could be due to crash, process being killed or any other reason that breaks connection between CWIC and Add-on. In order to detect that event event handler for "onAddonConnectionLost" event must be set:

        // Our event handler function for 'onAddonConnectionLost'
        function onAddonConnectionLost()
        {
            // Handle event...
        }

        // Registration of event handlers.
        cwic.SystemController.addEventHandler('onAddonConnectionLost', onAddonConnectionLost);

        // Calling API to initialize cwic library.
        cwic.SystemController.initialize();
    
NOTE: It is recommended to add this event handler before calling initialize.

Next

Previous