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

            tcpService.ReceiveMessage -= func;
        }