Class: SocketClient
Socket.IO client for real-time stream, search, and performance updates.
Namespace: EyesOnItSDK.SocketIO
Constructor
public SocketClient(string url, SocketIOOptions options = null)
Use the Socket.IO server URL exposed by your EyesOnIt deployment.
Events
| Event | Payload | Description |
|---|---|---|
OnConnected | none | Raised after the client connects. |
OnSubscribed | SubscribedData | Raised after a room subscription succeeds. |
OnStreamUpdate | StreamUpdateData[] | Raised when stream status data changes. |
OnStreamDetection | StreamDetectionsData | Raised when a stream detection is published. |
OnPerformanceUpdate | PerformanceUpdateDataWrapper | Raised when performance statistics are published. |
OnLiveSearchUpdate | LiveSearchUpdateData[] | Raised when live-search status data changes. |
OnLiveSearchDetection | StreamDetectionsData | Raised when a live search produces a detection. |
Methods
| Method | Returns | Description |
|---|---|---|
ConnectAsync() | Task | Opens the Socket.IO connection and registers handlers. |
DisconnectAsync() | Task | Closes the Socket.IO connection. |
JoinRoomAsync(string room) | Task | Subscribes to a server-defined room. |
LeaveRoomAsync(string room) | Task | Leaves a server-defined room. |
EmitAsync(string eventName, params object[] args) | Task | Sends a custom event. |
IsConnected() | bool | Returns the connection state. |
Usage Example
using EyesOnItSDK.SocketIO;
var socket = new SocketClient("http://localhost:8000");
socket.OnConnected += () => Console.WriteLine("Connected");
socket.OnStreamDetection += payload => Console.WriteLine(payload.StreamUrl);
await socket.ConnectAsync();
JoinRoomAsync and LeaveRoomAsync accept room names defined by your EyesOnIt server configuration.