Exemplo n.º 1
0
void
usnet_tcpev_process(usn_context_t *ctx)
{
   static char data[MAX_BUFFER_SIZE];
   int32_t len = 0;
   uint32_t flow = 0;
   uint32_t cnt = 0;
   while(1){
      len = 0;
      flow = 0;
      cnt++;
      if ( cnt % 10000 == 0 ) 
      {   
          DEBUG(ctx->log,"breaking the loop, cnt=%d", cnt);
          break;
      }   
      usnet_shmmq_dequeue(ctx->ev_net2app_mq, data, MAX_BUFFER_SIZE, &len, &flow);
      if ( len == 0 ) { 
         DEBUG(ctx->log,"empty queue: lastFactor=%d, newFactor=%d, cnt=%d",
                 ctx->ev_net2app_mq->_adaptive_ctrl->m_uiLastFactor, 
                 ctx->ev_net2app_mq->_adaptive_ctrl->m_uiFactor, cnt);
         return;
      }   
      usnet_tcpev_proc_handler(ctx, data, len, flow);
  }
  return;
}
Exemplo n.º 2
0
int32
usnet_tcpev_n2a_dequeue(u_char *buf, u_int32 buf_size, u_int32 *data_len)
{
   u_int32 flow = 0;
  
   DEBUG("dequeue an event");
   usnet_shmmq_dequeue(g_tcpev_net2app_mq, buf, buf_size, data_len, &flow); 

   return 0;
}