# LibTmux.Server.GetSessionsAsync

- **Module:** LibTmux.Server
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Server.Collections.cs#L14
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-server-getsessionsasync/

```
LibTmux.Server.GetSessionsAsync(cancellationToken: CancellationToken) -> Task<IReadOnlyList<Session>>
```

Reads every session on this server.

A handle that has not found a live server yet discovers one first.

## Parameters

- `cancellationToken` (CancellationToken): Cancels the tmux command.

## Returns

The sessions reported by a successful read.

## Raises

- `LibTmuxException`: The listing failed, including an absent daemon.
