Automatic reconnection
If a client drops a connection to a subscribed stream (for example, due to a drop in network connectivity in either client), it will attempt to automatically reconnect to the stream.
If a client drops a connection to a subscribed stream (for example, due to a drop in network connectivity in either client), it will attempt to automatically reconnect to the stream. When the stream is dropped and the client tries to reconnect, the OTSubscriber object dispatches a disconnected event. When the stream is restored, the OTSubscriber object dispatches a connected event. If the client cannot restore the stream, the OTSubscriber object dispatches a destroyed event.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and destroyed states:
The Subscriber object dispatches a disconnected event. When the stream is restored, the Subscriber object dispatches a connected event. If the client cannot restore the stream, the Subscriber object dispatched a destroyed event.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and destroyed states:
The SubscriberKit.StreamListener.onDisconnected(SubscriberKit subscriber) method is called. When the connection is restored, the SubscriberKit.StreamListener.onReconnected(SubscriberKit subscriber) method is called. If the client cannot restore the stream, the Session.SessionListener.onStreamDropped(Session session, Stream stream) method is called.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and destroyed states:
The OTSubscriberDelegate subscriberDidDisconnect(fromStream:) message is sent to the OTSubscriber object's delegate.
When the connection is restored, the OTSubscriberDelegate subscriberDidReconnect(toStream:) message is sent. If the client cannot restore the connection, the OTSessionDelegate session(_:streamDestroyed:) message is sent.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and disconnection states.
When the stream is dropped and the client tries to reconnect, the [OTSubscriberKitDelegate subscriberDidDisconnectFromStream:] message is sent to the OTSubscriberKit object's delegate.
When the connection is restored, the [OTSubscriberKitDelegate subscriberDidReconnectToStream:] message is sent. If the client cannot restore the connection, the [OTSessionDelegate session:streamDestroyed:] message is sent.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and disconnection states.
The Session object sends a StreamDisconnected event.
When the connection is restored, the Subscriber object sends a StreamReconnected event. If the client cannot restore the stream, the Session object sends a StreamDropped event.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and destroyed states:
When the stream is dropped and the client tries to reconnect, the on_disconnected callback function of the otc_subscriber_callbacks struct for the subscriber is called. When the connection is restored, the on_reconnected callback function of the otc_subscriber_callbacks struct for the subscriber is called.
If the client cannot restore the stream, the on_stream_dropped callback function of the otc_session_callbacks struct is called.
In response to these events, your application can (optionally) display user interface notifications indicating the temporary disconnection, reconnection, and destroyed states: