Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-30 Thread Arnaud Quette
2011/6/29 Arjen de Korte nut+de...@de-korte.org Citeren Arnaud Quette aquette@gmail.com: I guess I see the scanning code as a stopgap way to contact legacy servers (or what would be legacy after some discovery protocol like mDNS is set up), and either timeouts or non-blocking is just

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-30 Thread Arnaud Quette
2011/6/30 Charles Lepple clep...@gmail.com On Wed, Jun 29, 2011 at 3:56 PM, Arnaud Quette aquette@gmail.com wrote: 2011/6/29 Charles Lepple clep...@gmail.com To be honest, I'm not terribly excited about the notion of a NUT scanner just to disambiguate your words for Fred and

Re: [Nut-upsdev] Changes to upscli_connect

2011-06-29 Thread Arjen de Korte
Citeren Stuart D Gathman stu...@bmsi.com: Your test is with localhost - so any non-existent socket would get immediately rejected. The nut scanner has to deal with hosts on the network. If they send an ICMP reject, then there is no need for a timeout. But it is very common for a host to

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Arjen de Korte
Citeren Charles Lepple clep...@gmail.com: I guess I see the scanning code as a stopgap way to contact legacy servers (or what would be legacy after some discovery protocol like mDNS is set up), and either timeouts or non-blocking is just a kludge to make that work a little better. And

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Frédéric Bohé
On Wed, 2011-06-29 at 07:13 -0400, Charles Lepple wrote: On Jun 29, 2011, at 3:29 AM, Arjen de Korte wrote: Citeren Stuart D Gathman stu...@bmsi.com: Your test is with localhost - so any non-existent socket would get immediately rejected. The nut scanner has to deal with hosts on

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Arjen de Korte
Citeren Charles Lepple clep...@gmail.com: For the purpose of auto-detecting servers I'd propose to resurrect the UDP code and broadcast the servers presence once every 10 seconds or so. Yes, this has its drawbacks too (to make sure the broadcasts reach the potential clients), but this has

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Arnaud Quette
2011/6/29 Charles Lepple clep...@gmail.com On Jun 29, 2011, at 3:29 AM, Arjen de Korte wrote: Citeren Stuart D Gathman stu...@bmsi.com: Your test is with localhost - so any non-existent socket would get immediately rejected. The nut scanner has to deal with hosts on the network. If

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Arjen de Korte
Citeren Arnaud Quette aquette@gmail.com: I guess I see the scanning code as a stopgap way to contact legacy servers (or what would be legacy after some discovery protocol like mDNS is set up), and either timeouts or non-blocking is just a kludge to make that work a little better. And isn't

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Charles Lepple
On Wed, Jun 29, 2011 at 3:56 PM, Arnaud Quette aquette@gmail.com wrote: 2011/6/29 Charles Lepple clep...@gmail.com To be honest, I'm not terribly excited about the notion of a NUT scanner just to disambiguate your words for Fred and others: you were probably referring to nut-scanner

Re: [Nut-upsdev] Changes to upscli_connect (and general discovery)

2011-06-29 Thread Charles Lepple
On Wed, Jun 29, 2011 at 4:13 PM, Arjen de Korte nut+de...@de-korte.org wrote: as for the compat, IIRC Fred proposed a a new _tryconnect() method, upon which the standard _connect() would be mapped, with no behavior change. It is still unclear to me what we're trying to accomplish here, since

[Nut-upsdev] Changes to upscli_connect

2011-06-28 Thread Frédéric Bohé
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

Re: [Nut-upsdev] Changes to upscli_connect

2011-06-28 Thread Charles Lepple
On Jun 28, 2011, at 4:51 AM, Frédéric Bohé wrote: 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

Re: [Nut-upsdev] Changes to upscli_connect

2011-06-28 Thread Arjen de Korte
Citeren Frédéric Bohé fredericb...@eaton.com: 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. This is a serious problem, not only for the nut-scanner

Re: [Nut-upsdev] Changes to upscli_connect

2011-06-28 Thread Stuart D Gathman
On 06/28/2011 02:29 PM, Arjen de Korte wrote: Citeren Frédéric Bohé fredericb...@eaton.com: 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. The