org.jivesoftware.smack.ConnectionListener Java Examples

The following examples show how to use org.jivesoftware.smack.ConnectionListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XMPPTCPConnection.java    From Smack with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new XMPP connection over TCP (optionally using proxies).
 * <p>
 * Note that XMPPTCPConnection constructors do not establish a connection to the server
 * and you must call {@link #connect()}.
 * </p>
 *
 * @param config the connection configuration.
 */
public XMPPTCPConnection(XMPPTCPConnectionConfiguration config) {
    super(config);
    this.config = config;
    addConnectionListener(new ConnectionListener() {
        @Override
        public void connectionClosedOnError(Exception e) {
            if (e instanceof XMPPException.StreamErrorException || e instanceof StreamManagementException) {
                dropSmState();
            }
        }
    });

    // Re-init the reader and writer in case of SASL <success/>. This is done to reset the parser since a new stream
    // is initiated.
    buildNonzaCallback().listenFor(SaslNonza.Success.class, s -> resetParser()).install();
}
 
Example #2
Source File: XmppManager.java    From androidpn-client with Apache License 2.0 4 votes vote down vote up
public ConnectionListener getConnectionListener() {
    return connectionListener;
}
 
Example #3
Source File: XmppManager.java    From AndroidPNClient with Apache License 2.0 4 votes vote down vote up
public ConnectionListener getConnectionListener() {
    return connectionListener;
}
 
Example #4
Source File: XmppManager.java    From android-demo-xmpp-androidpn with Apache License 2.0 4 votes vote down vote up
public ConnectionListener getConnectionListener() {
    return connectionListener;
}