# LibTmux.PsmuxServer.ConnectAsync

- **Module:** LibTmux.PsmuxServer
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Psmux/PsmuxServer.cs#L57
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-psmuxserver-connectasync/

```
LibTmux.PsmuxServer.ConnectAsync(options: PsmuxConnectionOptions, cancellationToken: CancellationToken) -> Task<PsmuxServer>
```

Connects to a separately provisioned psmux namespace.

## Parameters

- `options` (PsmuxConnectionOptions): The executable trust and isolated endpoint settings.
- `cancellationToken` (CancellationToken): Cancels process startup and discovery.

## Returns

A query-only psmux server observation.

## Raises

- `ArgumentNullException`: <paramref name="options" /> is null.
- `InvalidOperationException`: The selected namespace has no live session.
- `NotSupportedException`: The executable, build, namespace, session count, or requested behavior is outside
the audited preview contract.
- `LibTmuxException`: The verified client could not complete discovery.
