Example #1
0
 private void Client_DataReceived(Client sender, byte[] buffer, int count)
 {
     Message message = MessageManager.Deserialize(buffer, count);
     if (message == null)
     {
         sender.Close();
         clients.Remove(sender);
         return;
     }
     InterpretMessage(message);
     Console.WriteLine("Message: " + System.Text.Encoding.Default.GetString(buffer, 0, count));
 }