# `ExIEC61850.IEC61850.Client.ReconnectWorker`
[🔗](https://github.com/Ultraluv/ex_iec61850/blob/v0.1.0/lib/ex_iec61850/iec61850/client/reconnect_worker.ex#L1)

Supervisor-friendly auto-reconnecting IEC 61850 client worker with exponential backoff.

Manages an underlying `IedConnection`, automatically reconnects on initial failure or
passive disconnect, and invokes `:on_connected` after every successful (re)connection
so callers can re-enable BRCB/URCB subscriptions.

## Example

    {:ok, worker} =
      ExIEC61850.IEC61850.Client.ReconnectWorker.start_link(
        host: "127.0.0.1",
        port: 102,
        initial_backoff_ms: 500,
        max_backoff_ms: 10_000,
        on_connected: fn conn -> IedConnection.get_logical_device_list(conn) end
      )

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `connected?`

```elixir
@spec connected?(GenServer.server()) :: boolean()
```

Returns `true` if the worker is currently connected to the IED server.

# `get_connection`

```elixir
@spec get_connection(GenServer.server()) :: pid()
```

Returns the underlying `IedConnection` pid.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
