# LibTmux.PsmuxServer.RefreshAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Psmux/PsmuxServer.cs#L154
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-psmuxserver-refreshasync/

```
LibTmux.PsmuxServer.RefreshAsync(cancellationToken: CancellationToken) -> Task<PsmuxServer>
```

Reconnects and returns a fresh server observation.

## Parameters

- `cancellationToken` (`CancellationToken`): Cancels process startup and discovery.

## Returns

A replacement observation using the same endpoint settings.

## Raises

- [`InvalidOperationException`](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception): The selected namespace has no live session.
- [`NotSupportedException`](https://learn.microsoft.com/dotnet/api/system.notsupportedexception): The executable, build, namespace, or session count is outside the preview contract.
- [`LibTmuxException`](/en/csharp/latest/reference/libtmux-libtmuxexception/): The verified client could not complete discovery.
