# LibTmux.Server.CreateOwnedAsync

- **Module:** LibTmux.Server
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Server.Lifecycle.cs#L199
- **Page:** https://libtmux.org/reference/dotnet/libtmux-server-createownedasync/

```
LibTmux.Server.CreateOwnedAsync(options: ServerConnectionOptions?, cancellationToken: CancellationToken) -> Task<OwnedServerScope>
```

Starts a server and takes ownership of it.

The scope holds an endpoint rather than a materialized server, because
a tmux server with no sessions exits at once. Creating the first session
through the endpoint both starts it for real and materializes it.

## Parameters

- `options` (ServerConnectionOptions?) — Connection options.
- `cancellationToken` (CancellationToken) — Cancels the tmux commands.

## Returns

A scope that stops the server when disposed.
