Re: stop trapd serivce on windows timeout?

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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 <[email protected]> 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 <[email protected]>
> *To:* Snmp Nmcsnmp <[email protected]>
> *Cc:* [email protected]
> *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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.