Skip to main content

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

EventPayloadDescription
OnConnectednoneRaised after the client connects.
OnSubscribedSubscribedDataRaised after a room subscription succeeds.
OnStreamUpdateStreamUpdateData[]Raised when stream status data changes.
OnStreamDetectionStreamDetectionsDataRaised when a stream detection is published.
OnPerformanceUpdatePerformanceUpdateDataWrapperRaised when performance statistics are published.
OnLiveSearchUpdateLiveSearchUpdateData[]Raised when live-search status data changes.
OnLiveSearchDetectionStreamDetectionsDataRaised when a live search produces a detection.

Methods

MethodReturnsDescription
ConnectAsync()TaskOpens the Socket.IO connection and registers handlers.
DisconnectAsync()TaskCloses the Socket.IO connection.
JoinRoomAsync(string room)TaskSubscribes to a server-defined room.
LeaveRoomAsync(string room)TaskLeaves a server-defined room.
EmitAsync(string eventName, params object[] args)TaskSends a custom event.
IsConnected()boolReturns 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.