public static void ClientOpened(SocketHandler socketHandler) { if (socketHandler.WebSocketContext.QueryString["monitorId"] != null) { _monitorId = Convert.ToInt32(socketHandler.WebSocketContext.QueryString["monitorId"].ToString()); } var client = new Client(_monitorId, socketHandler); Clients.Add(client); Functions.SendServerMessage(_monitorId + " is joined"); }
public static void ClientClosed(SocketHandler socketHandler) { Clients.RemoveAll(x => x.Socket == socketHandler); Functions.SendServerMessage(_monitorId + " is left"); }
public static void ClientMessaged(SocketHandler socketHandler, string message) { Functions.SendServerMessage(_monitorId + ": " + message); }