---
id: "E:cAlgo.API.Internals.IServer.Connected"
kind: "event"
type: "T:cAlgo.API.Internals.IServer"
url: "https://help.ctrader.com/ctrader-algo/references/Application/IServer/Connected/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# IServer.Connected

Member of [IServer](https://help.ctrader.com/ctrader-algo/references/Application/IServer/index.md).

## Connected

Event raised when successfully connected with the server

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
event Action Connected;
```

Python:

```python
api.Server.Connected += handler  # handler()
```

### Returns

`Action` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Server.Connected += OnServerConnected;
}

private void OnServerConnected()
{
    Print("Connection restored at {0}", Server.Time);
}
```

Python:

```python
def on_start(self):
    api.Server.Connected += self.on_server_connected

def on_server_connected(self):
    api.Print(f"Connection restored at {api.Server.Time}")
```

