示例#1
0
 void server_ClientConnectedEvent(object sender, ClientStatusArgs e)
 {
     lock (_listLock)
     {
         ClientAppList.Add(new ClientApp()
         {
             IPAddress = e.EndPoint.ToString(), Name = "name", Status = "Connected"
         });
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 private static void Client_OnChangeStatus(object sender, ClientStatusArgs e)
 {
     Console.WriteLine($"Change status = {e.Status}");
 }