On Sun, 27 Dec 2015 14:41:23 +0100 Dirk-Willem wrote:
DWVG> I’ve got an AgentX module that watches for specific multicast
DWVG> traffic, pulls a few bits out; and updates some counters
DWVG> accordingly. Consequentely I run the AgentX in non-blocking
DWVG> mode; as to (also) be able attend to the socket in parallel
DWVG> to handing SNMP requests. 
DWVG> 
DWVG> Code below works splendidly:
DWVG> [...]
DWVG>  
DWVG> However it obviously spins fast in this while(1){} loop;
DWVG> which is all the more a shame as both SNMP bulkwalks and
DWVG> multicast packets only come in every 100 seconds or slower.
DWVG> 
DWVG> What is the proper way to put a select() or poll() or similar
DWVG> onto the agent (file descriptor) ? And are there any
DWVG> caveats ? Or is there some way to register a handler on a fd
DWVG> separately ?

Sorry for the delayed response. register_readfd() should do what you want.

Robert

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to