private void HandleSpecialMessage(Client initiator, Message message) { string[] values = message.GetValues(); switch (values[0]) { case "name": initiator.Name = values.Length > 1 ? values[1] : "Anon"; ClientTable.ReloadData(); break; case "bye": DisconnectClient(initiator); break; } }
private void DisconnectClient(Client client) { client.Dispose(); Clients.Remove(client); ClientTable.ReloadData(); }
private void Stop() { Clients.Clear(); ClientTable.ReloadData(); Server.Stop(); }