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); } }
internal void Send(Message message) { stream.Send(message, messageSent, e => DisconnectPerson()); }