houxiao
2016-12-19 bd903c2ac65389760f46dffd3d9736011e11bc69
ProxyConsole/proxyconsole-hc.cpp
@@ -41,6 +41,8 @@
#define MAX 1024
#define fileread_buf 128
volatile time_t last_alarmout;
typedef std::map<std::string, int> hcnetsdk_user_t; // decoder_ip, userid
hcnetsdk_user_t g_hcnetsdk_user;
@@ -311,11 +313,15 @@
   if(NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,1) == FALSE){
      printf("NET_DVR_SetAlarmOut failed, err: %d\n", NET_DVR_GetLastError());
   }
   last_alarmout = time(NULL);
   
   sleep(3);
   
   //解除警报
   NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,0);
   if (time(NULL) - last_alarmout >= 3)
   {
      //解除警报
      NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,0);
   }
}
int hcnetsdk_alarm_popwin(LONG lUserID, const HCNetCameraConfig& camConfig)
@@ -496,13 +502,16 @@
      timer.it_interval.tv_usec=250000;
      /*Start a virtual timer.It counts down whenever this process is executing.*/
      setitimer(ITIMER_VIRTUAL,&timer,NULL);
      //setitimer(ITIMER_VIRTUAL,&timer,NULL);
      
      
      
      
      while(1)
         sleep(1);
      while ( 1 )
      {
         zclock_sleep(250);
         timer_handler(0);
      }
}
void* createServerthread_hcnetsdk(void* arg)