Exemple #1
0
 /// <summary>
 /// 获取实例
 /// </summary>
 /// <returns></returns>
 public static UdpService GetInstence()
 {
     if (udpService == null)
     {
         udpService = new UdpService();
     }
     return(udpService);
 }
Exemple #2
0
        /// <summary>
        /// 注销监听任务
        /// </summary>
        /// <param name="value"></param>
        /// <param name="func"></param>
        public static void UnRegisterUdpReceiveMessage(this object value, Action <Message> func)
        {
            UdpService udpService = UdpService.GetInstence();

            udpService.ReceiveMessage -= func;
        }