Available languages: [Python](https://databento.com/docs/api-live/client/reconnect.python.md) · [C++](https://databento.com/docs/api-live/client/reconnect.cpp.md) · [Rust](https://databento.com/docs/api-live/client/reconnect.rust.md) · [Raw](https://databento.com/docs/api-live/client/reconnect.raw.md)

Source: https://databento.com/docs/api-live/client/reconnect


### LiveClient::reconnect

Closes the current connection, then reopens the connection and authenticates with the live gateway.

#### API method

```rust
async fn reconnect(&mut self) -> crate::Result<()>;
```

#### Example usage

```rust
use databento::{
    LiveClient,
    dbn::{Dataset::IfeuImpact, SType, Schema},
    live::Subscription,
};

let mut client = LiveClient::builder()
    .key("$YOUR_API_KEY")?
    .dataset(IfeuImpact)
    .build()
    .await?;
// Close the connection
client.close().await?;
// Reopen the connection
client.reconnect().await?;
```
