/** * Adds a connection listener that will be notified if/when the connection to the server fails * while the client is idle (no calls being made). The default behavior is to ping for connection * every two seconds. */ public void addConnectionListener(ConnectionListener listener) { addConnectionListener(listener, (int)ConnectionValidator.DEFAULT_PING_PERIOD); }
/** * Adds a connection listener that will be notified if/when the connection to the server fails * while the client is idle (no calls being made). The current behavior is to ping the server * periodically. The time period is defined by the pingPeriod (which should be in milliseconds). */ public void addConnectionListener(ConnectionListener listener, int pingPeriod) { HashMap metadata = new HashMap(); metadata.put(ConnectionValidator.VALIDATOR_PING_PERIOD, Integer.toString(pingPeriod)); addConnectionListener(listener, metadata); }