static void Main(string[] args)
        {
            IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
            UdpClient udpClient;
            byte[] buffer;
            string loggingEvent;

            try
            {
                udpClient = new UdpClient(8081);
                while (true)
                {
                    buffer = udpClient.Receive(ref remoteEndPoint);
                    loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
                    Console.WriteLine(loggingEvent);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }

相关文章:

  • 2021-09-17
  • 2022-02-02
  • 2021-12-21
  • 2022-12-23
  • 2021-05-20
  • 2021-11-23
  • 2022-12-23
  • 2021-06-28
猜你喜欢
  • 2021-10-09
  • 2021-06-10
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案