# LibTmux.PsmuxServer.ConnectAsync

- **Module:** LibTmux.PsmuxServer
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Psmux/PsmuxServer.cs#L55
- **Page:** https://libtmux.org/reference/dotnet/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.
