[Nut-upsdev] Changes to upscli_connect
Frédéric Bohé
fredericbohe at eaton.com
Tue Jun 28 08:51:43 UTC 2011
Hello,
I am currently working on the nut scanner. For detecting available upsd
on the network, I rely on upscli_connect. The problem with this function
is that it calls a blocking "connect" function. So the nut-scanner is
blocked while waiting for the TCP timeout when trying to connect to an
IP without upsd available . Since this timeout may be rather long (3
minutes on my host), I would like to add a timeout parameter to
upscli_connect.
I propose to add a upscli_tryconnect function accepting a timeout
parameter, which will be the copy of the current upscli_connect + the
management of the timeout. The upscli_connect will be only a wrapper on
top of upscli_tryconnect, calling it without timeout.
Please let me know if this makes sense to you.
See a diff in attachment.
Regards,
Fred
--
Team Open Source Eaton - http://powerquality.eaton.com
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff_upsclient
Type: text/x-patch
Size: 2000 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110628/1127f4d1/attachment.bin>
More information about the Nut-upsdev
mailing list