Exemple #1
0
 public void Send()
 {
     while (true)
     {
         string msg = Console.ReadLine();
         if (msg.Contains("exit") || msg.Length > 255)
         {
             stream.Send(new Message(userName + ":<!exit!>"), messageSent, onSendError);
             Disconnect();
             return;
         }
         ClearLastLine();
         stream.Send(new Message(userName + ": " + msg), messageSent, onSendError);
     }
 }
Exemple #2
0
 internal void Send(Message message)
 {
     stream.Send(message, messageSent, e => DisconnectPerson());
 }