Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 private void DisconnectClient(Client client)
 {
     client.Dispose();
     Clients.Remove(client);
     ClientTable.ReloadData();
 }
Esempio n. 3
0
 private void Stop()
 {
     Clients.Clear();
     ClientTable.ReloadData();
     Server.Stop();
 }