Hello Huy, Are you aware that WSACancelBlockingCall() has been removed from Winsock 2, and that Net-SNMP needs Winsock 2 in order to support IPv6 ? See also http://msdn.microsoft.com/en-us/library/ms741547%28VS.85%29.aspx. So two possible solutions are: * Add a Windows-specific alarm to snmptrapd that is triggered e.g. once per second. This will limit the timeout argument of select(). See also the documentation of snmp_alarm_register() on http://www.net-snmp.org/dev/agent/group__snmp__alarm.html. * Or, more elegant, use a socket pair to let select() return when a service stop is requested. A socket pair can be created by calling create_winpipe_transport() (see also snmplib/winpipe.c). The read end of the socket pair can be registered for use in the select() call by calling register_readfd().
Bart. On Mon, May 24, 2010 at 6:31 AM, Snmp Nmcsnmp <nmc4s...@yahoo.com> wrote: > On windows XP service pack 3 it does not seem to stop in a timely manner. > If I put in the call WSACancelBlockingCall() then it break out fine. I will > test it on several version of windows and will broadcast what I learn from > it. > thanks, > Huy > > ------------------------------ > *From:* Bart Van Assche <bvanass...@acm.org> > *To:* Snmp Nmcsnmp <nmc4s...@yahoo.com> > *Cc:* net-snmp-users@lists.sourceforge.net > *Sent:* Sat, May 22, 2010 3:44:07 AM > > *Subject:* Re: stop trapd serivce on windows timeout? > > Hello Huy, > > The Win32 snmptrapd calls closesocket() on the UDP socket(s) owned by > snmptrapd to make select() stop. While this seems to work with some Windows > versions (e.g. Windows XP), this is undocumented Winsock behavior. So > whether or not this works may depend on the Windows version. On which > Windows version did you observe this behavior ? >
------------------------------------------------------------------------------
_______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users