> I need to force the snmpd agent to use the timeout instead of blocking
> inside the 'select' function.
> 
> This is the piece of code in the snmpd agent where it decides whether to
> blocking or not:
> ***********
>         block = 0;
>         snmp_select_info(&numfds, &readfds, tvp, &block);
>         if (block == 1) {
>             tvp = NULL;         /* block without timeout */
>               }
> ***********
> I've tried to set 'block = 1' in the first row of the code above with no
> result.

No - that's precisely the wrong thing to do.
If you set "block = 1", then the agent *will* block in the select call,
and will do so indefinitely.

What you probably need to do is to set the contents of the timeout structure
to be 0.  Not NULL (which means block), but 0.

Look a little bit earlier where it says

        tvp->tv_sec  = SOMETHING;
        tvp->tv_usec = SOMETHING;

and set both of those to be 0.
That should do the trick...


Dave




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to