Пример #1
0
static void
transport_running(void)
{
  snmp_event_init();
  snmp_event_add(agentx_entry.sock, SNMP_EV_READ, agentx_read_handler, NULL);
  snmp_event_add(agentx_entry.sigfd, SNMP_EV_READ, agentx_signal_handler, NULL);
  snmp_event_run();
}
static int
transport_step(long timeout)
{
  static int inited = 0;
  if (inited == 0) {
    snmp_event_init();
    snmp_event_add(agentx_entry.sock, SNMP_EV_READ, agentx_read_handler, NULL);
    snmp_event_add(agentx_entry.sigfd, SNMP_EV_READ, agentx_signal_handler, NULL);
    inited = 1;
  }
  return snmp_event_step(timeout);
}