# OpcClient.MaxReconnectDuration Property

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClient</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcClient Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

<span class="api-meta">since v2.58</span>

Gets or sets the time after which the client stops attempting to reconnect to a halted session.

<div class="api-signature" data-lang="csharp">

```csharp
public int MaxReconnectDuration { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property MaxReconnectDuration As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The time in milliseconds counted from the start of the reconnect. A value equals zero indicates that the client keeps attempting until an attempt succeeds. The default value is zero.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The value is less than zero. |

**Remarks**

When the time has elapsed, the client changes to [Disconnected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientstate/#disconnected) and raises [BreakDetected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/breakdetected). It does not reconnect again on its own; [Connect](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/connect) establishes a new connection. The value has no effect while [ReconnectInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/reconnectinterval) is zero.
