//private static readonly object m_lock02 = new object(); /// <summary> /// 用户退出请求 /// </summary> /// <param name="_obj"></param> /// <param name="_sendback"></param> public static void fns_clientExit(string _obj, I_sendBackClient _sendback) { //lock (m_lock02) //{ I_sendBackClient t_send = _sendback; N_msg_userExit t_userout = JsonMapper.ToObject <N_msg_userExit>(_obj); if (t_userout != null) { new Task(() => { //做些退出处理 I_RemoveClient t_removeClient = S_ClientSocket.M_instance; if (t_removeClient != null) { t_removeClient.fni_remove(t_userout.m_username); I_checkIsLoaded t_checkIsLoaded = S_sql.M_instance; t_checkIsLoaded.fni_remove(t_userout.m_username); } }).Start(); } //} }
/// <summary> /// 用于意外退出情况使用,请求管理销毁此客户端 /// </summary> protected void fnp_exit_acc() { new Task(() => { //做些退出处理 I_RemoveClient t_removeClient = S_ClientSocket.M_instance; if (t_removeClient != null) { t_removeClient.fni_remove(m_clientID); } }).Start(); }