Beispiel #1
0
        /* Start UDP server */
        private void StartUDPServer()
        {
            SimpleUdpServer udpServer = new SimpleUdpServer(rpcProgram.GetPort(), rpcProgram,
                                                            1);

            rpcProgram.StartDaemons();
            try
            {
                udpServer.Run();
            }
            catch (Exception e)
            {
                Log.Fatal("Failed to start the UDP server.", e);
                if (udpServer.GetBoundPort() > 0)
                {
                    rpcProgram.Unregister(PortmapMapping.TransportUdp, udpServer.GetBoundPort());
                }
                udpServer.Shutdown();
                ExitUtil.Terminate(1, e);
            }
            udpBoundPort = udpServer.GetBoundPort();
        }