Enclosing class:
: Session
public static interface Session.ReconnectionListener
Monitors when an a client tries to automatically reconnect after losing its connection to an OpenTok session.
See Also:
: - Session.setReconnectionListener(ReconnectionListener listener)
Method Summary
All MethodsInstance MethodsAbstract Methods
Modifier and Type
Method
Description
void
onReconnected(Session session)
Invoked when the local client has reconnected to the OpenTok session after its network connection was lost temporarily.
void
onReconnecting(Session session)
Invoked when the local client has lost its connection to an OpenTok session and is trying to reconnect.
Method Details
onReconnecting
void onReconnecting(Session session)
Invoked when the local client has lost its connection to an OpenTok session and is trying
to reconnect. This results from a loss in network connectivity. If the client can
reconnect to the session, the
onReconnected(Session session) method is called.
Otherwise, if the client cannot reconnect, the
Session.SessionListener.onDisconnected(Session session) method is called.
In response to this method being called, you may want to provide a user interface notification, to let the user know that the app is trying to reconnect to the session and that audio-video streams are temporarily disconnected.
Parameters:
: session - The session your client is attempting to reconnect to.
See Also:
: - onReconnected(Session session)
onReconnected
void onReconnected(Session session)
Invoked when the local client has reconnected to the OpenTok session after its
network connection was lost temporarily. When the connection is lost, the
onReconnecting(Session session) method is called,
prior to the Session.ReconnectionListener.onReconnected(Session session)
method. If the client cannot reconnect to the session, the
Session.SessionListener.onDisconnected(Session session) method is called.
Any existing publishers and subscribers are automatically reconnected when the client reconnects and this method is called.
By default, any signals initiated by the the local client using the
Session.sendSignal(String type, String data) method are sent when the client
reconnects. To prevent any signals initiated while disconnected from being sent,
use the Session.sendSignal(String type, String data, boolean retryAfterReconnect)
method to send the signal, and set the retryAfterReconnect parameter to
false. (All signals sent by other clients while your client was disconnected
are received upon reconnecting.)
Parameters:
: session - The session your client reconnected to.
See Also:
: - onReconnecting(Session session)