# LibTmux.FSharp.Server.createOwned

- **Module:** LibTmux.FSharp
- **Package:** LibTmux.FSharp
- **Language:** F#
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.FSharp/Hierarchy.fsi#L20
- **Page:** https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-server-createowned/

```
val createOwned: cancellationToken: CancellationToken -> options: ServerConnectionOptions -> Task<OwnedServerScope>
```

Starts a server on the socket the options name and owns it; disposing the scope stops it.

The core's <c>Server.CreateOwnedAsync</c>, named so F# need not qualify
the type this module shares a name with. A server already listening on
the default socket is refused rather than owned.

## Parameters

- `cancellationToken` (`CancellationToken`)
- `options` (`ServerConnectionOptions`)

## Raises

- [`System.InvalidOperationException`](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception): A server is already listening on the default socket.
- [`LibTmux.TmuxCommandException`](/en/csharp/latest/reference/libtmux-tmuxcommandexception/): tmux failed to say whether a server is listening, such as on a socket it may not open.
