示例#1
0
        private void sendMessage(string message = "", bool manual = false)
        {
            if (!string.IsNullOrWhiteSpace(message))
            {
                _client?.receive();

                _client?.send(message);

                tb_chat_history.AppendText($@"[ Me ]: {message + Environment.NewLine}");

                if (manual)
                {
                    tb_chat_message.Clear();
                }
            }
        }
 private void send2_Click(object sender, RoutedEventArgs e)
 {
     byte[] byteData = Encoding.ASCII.GetBytes("This is a test 2<EOF>");
     AsyncClient.send(ref byteData);
 }