# LibTmux.Server.InspectAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Server.Identity.cs#L112
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-server-inspectasync/

```
LibTmux.Server.InspectAsync(cancellationToken: CancellationToken) -> Task<Server?>
```

Reads the live endpoint identity without running its initializer.

Reuses the resolved endpoint and reads its current generation and daemon version.
No initializer runs, including when the returned handle is subsequently connected.
Captured relationships are not acquired or copied. A materialized input remains
bound to its generation and cannot adopt a replacement daemon.

## Parameters

- `cancellationToken` (`CancellationToken`): Cancels inspection before publication.

## Returns

A materialized identity-only handle, or null when no daemon is listening.

## Raises

- [`StaleServerGenerationException`](/en/csharp/latest/reference/libtmux-staleservergenerationexception/): A different daemon owns the endpoint.
- [`LibTmuxException`](/en/csharp/latest/reference/libtmux-libtmuxexception/): Inspection failed for a reason other than verified daemon absence.
- [`InvalidOperationException`](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception): This handle has no connection identity.
- [`OperationCanceledException`](https://learn.microsoft.com/dotnet/api/system.operationcanceledexception): Inspection was cancelled before publication.
