示例#1
0
        public static Socket_S getInstance()
        {
            if (s_instance == null)
            {
                s_instance = new Socket_S();
            }

            return(s_instance);
        }
示例#2
0
 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]);
         }
     }
 }
示例#3
0
 public static void startCheckHeartBeat()
 {
     Timer m_timer = new Timer(onTimerCheckHeartBeat, "", (int)(Socket_S.getInstance().m_heartBeatTime * 1000), (int)(Socket_S.getInstance().m_heartBeatTime * 1000));
 }