Hi,
 
I would suggest to call agent_check_and_process with parameter "0" to make it non-blocking and check your trap-conditions in the same loop. Thats the way I do it.
 
regards
Wolfgang


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Nikanth K
Gesendet: Freitag, 28. April 2006 13:11
An: net-snmp-coders@lists.sourceforge.net; net-snmp-users@lists.sourceforge.net
Betreff: TRAPS + get requests

Hi
I am developing an agentx subagent on SUSE.
The problem is, I want to handle GET requests as well as TRAPS to be sent by the same subagent.
But to handle get requests we need to loop on
       while(1)
        {
                agent_check_and_process(1); /* 0 == don't block */
        }
And I want to monitor and send traps as well.

If I use multi-threading(pthreads) to do this,i.e., one thread monitors and sends traps and the other handles get-requests -  the subagent crashes at some point of time. I heard multi-threading is not supported.

What is the best way to handle such situation?

Thanks & Regards
Nikanth

Reply via email to