public static Socket_S getInstance() { if (s_instance == null) { s_instance = new Socket_S(); } return(s_instance); }
static void onTimerCheckHeartBeat(object data) { for (int i = s_clientList.Count - 1; i >= 0; i--) { int miaoshucha = CommonUtil.miaoshucha(s_clientList[i].m_lastHeratBeatTime, CommonUtil.getCurTimeNormalFormat()); if (miaoshucha > (Socket_S.getInstance().m_heartBeatTime * 3)) { Socket_S.getInstance().DisconnectWithClient(s_clientList[i]); } } }
public static void startCheckHeartBeat() { Timer m_timer = new Timer(onTimerCheckHeartBeat, "", (int)(Socket_S.getInstance().m_heartBeatTime * 1000), (int)(Socket_S.getInstance().m_heartBeatTime * 1000)); }