> For the complete documentation index, see [llms.txt](https://enghouse-vidyo.gitbook.io/vidyoplatform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enghouse-vidyo.gitbook.io/vidyoplatform/use-cases/automatic-reconnection.md).

# Automatic Reconnection

Auto-reconnect refers to a feature that automatically attempts to re-establish a lost connection during a video conference session, in case of connection issues like poor network or exchanging between Wi-Fi and cellular network. Auto-reconnect in video conferencing swiftly restores connections, eliminating the need for manual reconnection.

Auto-reconnect functionality serves several use cases across different domains. Here are some common use cases for auto-reconnect:

Video Conferencing:

* Scenario: A user experiences a brief network disruption during a video conference.
* Use Case: Auto-reconnect ensures seamless participation by automatically attempting to restore the connection, minimizing disruptions in virtual meetings.

Mobile Applications:

* Scenario: A mobile user moves between different network environments (Wi-Fi to cellular, for example).
* Use Case: Auto-reconnect adapts to changing network conditions, allowing users to stay connected during transitions and providing a smoother mobile experience.

Cloud Services:

* Scenario: Cloud-based applications face occasional server unavailability.
* Use Case: Auto-reconnect enables applications to automatically retry connections to cloud servers, improving the reliability of cloud-based services.

Auto-Reconnect isn't enabled by default in the SDK and by following the below steps clients can implement it in their application.

**Steps to Use the API:**

To use the API for reconnecting the call user needs to register Reconnect Event listener as follows.                &#x20;

**Register Listeners:**

1\)      **Register for reconnecting events.**

public class MyClass : Connector.IRegisterReconnectEventListener

&#x20;   {

&#x20;public void OnConferenceLost(Connector.ConnectorFailReason reason)

&#x20;       {/\*You can Change the Connection state to disconnected\*/}               &#x20;

&#x20;public void OnReconnected()

&#x20;       {/\* You can Change the Connection state to connected\*/}

public void OnReconnecting(uint attempt, uint attemptTimeout, Connector.ConnectorFailReason reason)

&#x20;       { /\* \*/}

&#x20;   }

There are three cases that can occur during reconnecting: conference lost, reconnected and reconnecting.

**OnConferenceLost** - This callback will be triggered when the reconnecting attempt started.

**Reconnected**: This callback will be triggered when the connection was established, and the user joined to the call/conference.

**Reconnecting**: This callback will be triggered when the reconnecting attempt started.

2\)      Call the \_connector.RegisterReconnectEventListener() method.

**To Enable AutoReconnect:**

\-          Enable the Auto Reconnect as follows:

VidyoConnectorSetAdvancedOptions(vc, “{“enableAutoReconnect“ : true}“);

**For example using windows SDK (C#)** you can use the API as: \_connector.SetAdvancedOptions("{\\"enableAutoReconnect\\" : true}");

\-       You can also set the number of attempts and backoff time to be taken before reconnecting/disconnecting as follows:

**To Set reconnect Attempts and reconnectBackoff time:**

VidyoConnectorSetAdvancedOptions(vc, “{“enableAutoReconnect“ : true, “maxReconnectAttempts“ : 4, “reconnectBackoff“ :  5}“);

·       **maxReconnectAttempts**: Number of attempts to tried before disconnecting the call.

·       **reconnectBackoff** : waiting period before next attempt and **this** will be doubled on every next attempt.

**In C#:** \_connector.SetAdvancedOptions("{\\"enableAutoReconnect\\" : true, \\"maxReconnectAttempts\\" : 4, \\"reconnectBackoff\\" :  5}");

**To Disable Reconnect:**

VidyoConnectorSetAdvancedOptions(vc, “{“enableAutoReconnect“ : false}“);

**In C#:** \_connector.SetAdvancedOptions("{\\"enableAutoReconnect\\" : false}");

Auto-reconnect feature in video conferencing plays a crucial role in maintaining a reliable and user-friendly communication environment. It helps reduce downtime, ensures seamless connectivity, and contributes to a positive user experience, ultimately supporting effective collaboration in both professional and personal settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enghouse-vidyo.gitbook.io/vidyoplatform/use-cases/automatic-reconnection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
