void server_ClientConnectedEvent(object sender, ClientStatusArgs e) { lock (_listLock) { ClientAppList.Add(new ClientApp() { IPAddress = e.EndPoint.ToString(), Name = "name", Status = "Connected" }); } }
void server_ClientDisconnectedEvent(object sender, ClientStatusArgs e) { lock (_listLock) { ClientApp removeApp = null; foreach (ClientApp app in ClientAppList) { if (app.IPAddress == e.EndPoint.ToString()) { removeApp = app; } } ClientAppList.Remove(removeApp); } }
private static void Client_OnChangeStatus(object sender, ClientStatusArgs e) { Console.WriteLine($"Change status = {e.Status}"); }