# AR51Client

<Badge tone="type">static class</Badge> <Badge>thread-safe</Badge>

```csharp
namespace AR51.Net;

public static class AR51Client
```

Creates [`IAR51Client`](/docs/sdk-api/csharp-api/classes/iar51client/) instances.

:::tip[How-to]
This page is **reference** (facts only). For a walkthrough with a complete sample, see the [Connecting guide](/docs/csharp-api/connecting/).
:::

<Example>

```csharp
await using IAR51Client ar51 = AR51Client.Create();
ar51.Skeletons.SkeletonReceived += (_, e) => Console.WriteLine(e.Skeleton.GetPosition(Joint.MidHip));
await ar51.StartAsync();
```

</Example>

## Method summary

<div className="apiTable">

| Method | Returns | |
|---|---|---|
| [`Create`](#create) | [`IAR51Client`](/docs/sdk-api/csharp-api/classes/iar51client/) | <Badge>static</Badge> |

</div>

→ Full descriptions in [Method details](#method-details) below.

## Method details

### Create

<ApiBody kind="method" tags="static">

```csharp
public static IAR51Client Create(AR51ClientOptions? options = null, ILoggerFactory? loggerFactory = null);
```

Creates a client. It does not connect until [`IAR51Client.StartAsync`](/docs/sdk-api/csharp-api/classes/iar51client/#startasync) is called.

<Params>
<Param name="options" type="AR51ClientOptions?" typeHref="/docs/sdk-api/csharp-api/classes/ar51clientoptions/">Connection settings. `null` finds the server on the local network. Optional.</Param>
<Param name="loggerFactory" type="ILoggerFactory?" typeHref="https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggerfactory">Receives the client's diagnostic log. `null` disables logging. Optional.</Param>
</Params>

<Returns type="IAR51Client" typeHref="/docs/sdk-api/csharp-api/classes/iar51client/">A new, not yet connected client.</Returns>

<Throws>
<Throw type="ArgumentOutOfRangeException" typeHref="https://learn.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception">A port or time span in `options` is out of range.</Throw>
</Throws>

</ApiBody>

## See also

- [Connecting guide](/docs/csharp-api/connecting/) — walkthrough with a complete, compiled sample
- [Class index](/docs/sdk-api/csharp-api/classes/) — every AR51.Net type
- [Data conventions, threading and errors](/docs/csharp-api/conventions/)
