Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var msg = new MessageCommand <TextMessage>
            {
                Content = new TextMessage {
                    Content = "ce shi shu ju "
                },
            };

            _server.GetSocket().SendTo(msg.Serialize(), new IPEndPoint(IPAddress.Parse(tbip.Text.Trim()), int.Parse(textBox2.Text.Trim())));
        }
Exemple #2
0
 public void Send <T>(MessageCommand <T> messageCommand) where T : IMessage
 {
     _socket.SendTo(messageCommand.Serialize(), messageCommand.Target);
 }