/// <summary> /// 获取实例 /// </summary> /// <returns></returns> public static TcpService GetInstence() { if (tcpService == null) { tcpService = new TcpService(); } return(tcpService); }
/// <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; }