Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-29 Thread MrJean1
Take a look at function timelimited in this recipe /Jean On Nov 29, 8:08 am, r0g wrote: > r0g wrote: > > r0g wrote: > >> Gabriel Genellina wrote: > >>> En Fri, 27 Nov 2009 22:35:36 -0300, r0g > >>> escribió: > > gethostbyname ignores setdefa

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-29 Thread r0g
r0g wrote: > r0g wrote: >> Gabriel Genellina wrote: >>> En Fri, 27 Nov 2009 22:35:36 -0300, r0g >>> escribió: >>> gethostbyname ignores setdefaulttimeout. How big a job is it to use non-blocking sockets to write a DNS lookup function with a customisable timeout? A few lines? A

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread r0g
r0g wrote: > Gabriel Genellina wrote: >> En Fri, 27 Nov 2009 22:35:36 -0300, r0g >> escribió: >> >>> gethostbyname ignores setdefaulttimeout. >>> >>> How big a job is it to use non-blocking sockets to write a DNS lookup >>> function with a customisable timeout? A few lines? A few hundred? I'd As

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread r0g
Gabriel Genellina wrote: > En Fri, 27 Nov 2009 22:35:36 -0300, r0g > escribió: > >> gethostbyname ignores setdefaulttimeout. >> >> How big a job is it to use non-blocking sockets to write a DNS lookup >> function with a customisable timeout? A few lines? A few hundred? I'd >> only need to resolv

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread J Sisson
On Fri, Nov 27, 2009 at 9:20 PM, r0g wrote: > Ahh so close. I set the alarm for 3 seconds and it raises the exception, > but only after spending 25 seconds seemingly blocked in gethostbyname. > > Here's a snippet, just in case I'm doing it wrong!... > > If you're doing many lookups prior to conne

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread MRAB
r0g wrote: Hi, I'm writing a reliability monitoring app but I've run into a problem. I was hoping to keep it very simple and single threaded at first but that's looking unlikely now! The crux of it is this... gethostbyname ignores setdefaulttimeout. It seems gethostbyname asks the OS to resolv

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread r0g
John Bokma wrote: > r0g wrote: > >> It seems gethostbyname asks the OS to resolve the address and the OS >> uses it's own timeout value ( 25 seconds ) rather than the one provided >> in setdefaulttimeout. 25 seconds of blocking is way too long for me, I >> want the response within 5 seconds or no

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread Gabriel Genellina
En Fri, 27 Nov 2009 22:35:36 -0300, r0g escribió: gethostbyname ignores setdefaulttimeout. How big a job is it to use non-blocking sockets to write a DNS lookup function with a customisable timeout? A few lines? A few hundred? I'd only need to resolve v4 addresses for the foreseeable. Thi

Re: Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread John Bokma
r0g wrote: > It seems gethostbyname asks the OS to resolve the address and the OS > uses it's own timeout value ( 25 seconds ) rather than the one provided > in setdefaulttimeout. 25 seconds of blocking is way too long for me, I > want the response within 5 seconds or not at all but I can see no

Best strategy for overcoming excessive gethostbyname timeout.

2009-11-27 Thread r0g
Hi, I'm writing a reliability monitoring app but I've run into a problem. I was hoping to keep it very simple and single threaded at first but that's looking unlikely now! The crux of it is this... gethostbyname ignores setdefaulttimeout. It seems gethostbyname asks the OS to resolve the address