---
id: "T:cAlgo.API.WebSocketClientBinaryReceivedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientBinaryReceivedEventArgs/"
---

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

# WebSocketClientBinaryReceivedEventArgs (class)

Provides data for WebSocketClient binary data received event.

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

- Cloud: Never raised in the cloud: the events that pass it never fire there (WebSocketClient.BinaryReceived).

## Definition

```csharp
public class WebSocketClientBinaryReceivedEventArgs
```

## Examples

C#:

```csharp
private WebSocketClient _client = new WebSocketClient();

protected override void OnStart()
{
    _client.BinaryReceived += OnBinaryReceived;
    _client.Connect(new Uri("wss://example.com/stream"));
}

private void OnBinaryReceived(WebSocketClientBinaryReceivedEventArgs args)
{
    Print("Received {0} bytes, client state: {1}", args.Data.Length, args.Client.State);
}
```

Python:

```python
from System import Uri

def on_start(self):
    self.client = WebSocketClient()
    self.client.BinaryReceived += self.on_binary_received
    self.client.Connect(Uri("wss://example.com/stream"))

def on_binary_received(self, args):
    api.Print(f"Received {len(args.Data)} bytes, client state: {args.Client.State}")
```

## Properties

- `public WebSocketClient Client {get;}` — Websocket client instance. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientBinaryReceivedEventArgs/Client/index.md)
- `public byte[] Data {get;}` — Received data. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientBinaryReceivedEventArgs/Data/index.md)

