protected override void OnClientConnected(Socket clientSocket) { MonitoringClient client = new MonitoringClient(clientSocket); client.ClientDisconnected += OnClientDisconnected; mClientsList.Add(client); client.HandleClient(); }
protected override void OnClientDisconnected(object sender, EventArgs e) { if (sender is MonitoringClient) { MonitoringClient client = sender as MonitoringClient; mClientsList.Remove(client); client.Dispose(); } }