コード例 #1
0
        private async void Server_OnMessageReceived(object sender, UDPMessageArgs e)
        {
            Console.WriteLine("[UDPServer] Message Received from: " + e.Remote.Address.ToString() + ":" + e.Remote.Port.ToString());
            Console.WriteLine("[UDPServer] Message: " + Encoding.ASCII.GetString(e.Message).Trim());

            await server.SendAsync(e.Remote, Encoding.ASCII.GetBytes("this is my server response"));
        }
コード例 #2
0
 public async void Send(string msg)
 {
     await client.SendAsync(Encoding.ASCII.GetBytes(msg));
 }