/// /// 多线程通信总线 /// public static class MsgBus { private static readonly UDPServer udpServer = new UDPServer(1234); /// /// 获取UDP服务器 /// public static UDPServer UDPServer { get { return udpServer; } } private static bool isRunning = false; /// /// 获取通信总线运行状态 /// public static bool IsRunning { get { return isRunning; } } /// /// 通信总线初始化 /// /// public static void Init() { udpServer.Start(); isRunning = true; } /// /// 关闭通信总线 /// /// public static void Exit() { udpServer.Stop(); isRunning = false; } }