Beispiel #1
0
        /// <summary>
        /// Runs the UDP server mode
        /// </summary>
        public void Run()
        {
            UdpEchoServer echoServer = new UdpEchoServer(serverPort);
            echoServer.OnDataReceived += new UdpEchoServer.DataReceivedDelegate(echoServer_OnDataReceived);
            echoServer.OnSocketException += new UdpEchoServer.SocketExceptionDelegate(echoServer_OnSocketException);

            Console.WriteLine(string.Format(Messages.UDPServerCaption, serverPort));

            echoServer.Start();
            Console.ReadKey(true);
            echoServer.Stop();
        }
Beispiel #2
0
        /// <summary>
        /// Runs the UDP server mode
        /// </summary>
        public void Run()
        {
            var echoServer = new UdpEchoServer(_serverPort);
            echoServer.OnDataReceived += echoServer_OnDataReceived;
            echoServer.OnSocketException += echoServer_OnSocketException;

            Console.WriteLine(Messages.UDPServerCaption, _serverPort);

            echoServer.Start();
            Console.ReadKey(true);
            echoServer.Stop();
        }