---
id: "P:cAlgo.API.WebSocketClient.CloseStatusDescription"
kind: "property"
type: "T:cAlgo.API.WebSocketClient"
url: "https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClient/CloseStatusDescription/"
---

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

# WebSocketClient.CloseStatusDescription

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

## CloseStatusDescription

Gets a description of the reason why the instance was closed.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Connect, Send and Close do nothing: "WebSocket is not supported in cloud environment." is written to the log, State stays None and no events are raised.

C#:

```csharp
public string CloseStatusDescription {get;}
```

Python:

```python
webSocketClient.CloseStatusDescription: str
```

### Returns

`string` — 

### Examples

C#:

```csharp
var client = new WebSocketClient();
client.Disconnected += args => Print("Close reason: {0}", args.Client.CloseStatusDescription);
client.Connect(new Uri("wss://stream.example.com/quotes"));
```

Python:

```python
from System import Uri

client = WebSocketClient()
client.Disconnected += lambda args: api.Print(f"Close reason: {args.Client.CloseStatusDescription}")
client.Connect(Uri("wss://stream.example.com/quotes"))
```

