# Network Disruptions

Connection problems can occur during a call, for example when switching networks
or if the signal is poor. In this case the SDK will try to reconnect
automatically.

The `call.setDisconnectionTimeout` method allows you to specify how long a user
can remain disconnected before being removed from the call. This is particularly
useful when users experience short network interruptions and are able to
reconnect quickly. By setting a timeout you ensure that users are only dropped
if their disconnection lasts longer than the specified time.

## Setting the disconnection timeout

Once the call has been created, you can set a disconnection timeout that defines
how long a user can stay disconnected before being dropped. Here’s how to do it:

```ts
call.setDisconnectionTimeout(30); // Try to reconnect for 30 seconds
call.setDisconnectionTimeout(0); // try to reconnect indefinitely (default)
```

By default the disconnection timeout is set to `0`, allowing the user to
remain in the call until their connection restores or the call is ended.

## Notify user after disconnection

Current reconnection state is reflected in the calling state.

After a specified timeout, if the connection is not reestablished, the calling
state becomes `CallingState.RECONNECTING_FAILED`. We can subscribe to it to
display a special UI, notifying user after disconnection:

```ts
call.state.callingState$.subscribe((state) => {
  if (state === CallingState.RECONNECTING_FAILED) {
    console.log("Reconnecting failed");
  }
});
```


---

This page was last updated at 2026-08-10T16:01:06.410Z.

For the most recent version of this documentation, visit [https://getstream.io/video/docs/javascript/ui-cookbook/network-disruption/](https://getstream.io/video/docs/javascript/ui-cookbook/network-disruption/).