Interface Session.ReconnectionListener
-
- 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.
-
-
Method Summary
All Methods Instance Methods Abstract 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 Detail
-
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, theonReconnected(Session session)
method is called. Otherwise, if the client cannot reconnect, theSession.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, theonReconnecting(Session session)
method is called, prior to theSession.ReconnectionListener.onReconnected(Session session)
method. If the client cannot reconnect to the session, theSession.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 theSession.sendSignal(String type, String data, boolean retryAfterReconnect)
method to send the signal, and set theretryAfterReconnect
parameter tofalse
. (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)
-
-