Session.ReconnectionListener
public abstract static interface ReconnectionListener
Enclosing class: Session
Monitors when an a client tries to automatically reconnect after losing its connection to an OpenTok session.
Methods
| Name | Description |
|---|---|
onReconnected(session) |
Invoked when the local client has reconnected to the OpenTok session after its network connection was lost temporarily. |
onReconnecting(session) |
Invoked when the local client has lost its connection to an OpenTok session and is trying to reconnect. |
onReconnected(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
Session.ReconnectionListener#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:
| Name | Type | Description |
|---|---|---|
session |
Session | The session your client reconnected to. |
See:
: - onReconnecting(Session session)
onReconnecting(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
Session.ReconnectionListener#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:
| Name | Type | Description |
|---|---|---|
session |
Session | The session your client is attempting to reconnect to. |
See:
: - onReconnected(Session session)