Re: socket setdefaulttimeout

2005-08-17 Thread Steve Holden
Sheila King wrote: > I'm doing DNS lookups on common spam blacklists (such as SpamCop..and > others) in an email filtering script. Sometimes, because the DNS server > that is resolving the looksup can go down, it is important to make sure > that the socket doesn't just hang there waiting for a resp

Re: socket setdefaulttimeout

2005-08-15 Thread bryanjugglercryptographer
Michael P. Soulier wrote: > On 13/08/05 Bryan Olson said: > > > The seperate thread-or-process trick should work. Start a deamon > > thread to do the gethostbyname, and have the main thread give up > > on the check if the deamon thread doesn't report (via a lock or > > another socket) within, say,

Re: socket setdefaulttimeout

2005-08-15 Thread Michael P. Soulier
On 13/08/05 Bryan Olson said: > The seperate thread-or-process trick should work. Start a deamon > thread to do the gethostbyname, and have the main thread give up > on the check if the deamon thread doesn't report (via a lock or > another socket) within, say, 8 seconds. Wouldn't an alarm be much

Re: socket setdefaulttimeout

2005-08-13 Thread John Machin
Dennis Lee Bieber wrote: > > I've got the opposite problem -- I'm on a dial-up (well, for a few > more weeks -- until the DSL gear arrives). For some reason DNS lookups > seem to be low priority and, if I'm downloading messages in Agent (from > three servers yet) and email (Eudora), Firefox

Re: socket setdefaulttimeout

2005-08-13 Thread Sheila King
Bryan: Thanks for the tips/suggestion. I will definitely look into that. (It will be my first foray into coding with threads...I do appreciate that you've laid a great deal of it out. I will certainly refer to my references and do substantial testing on this...) Thanks! -- Sheila King http://ww

Re: socket setdefaulttimeout

2005-08-12 Thread Bryan Olson
Sheila King wrote: > Bryan Olson wrote: [...] >>Under some older threading systems, any system call would block every >>thread in the process, and gethostbyname was notorious for holding things >>up. Some systems offer an asynchronous gethostbyname, but that doesn't >>help users of Python's l

Re: socket setdefaulttimeout

2005-08-12 Thread Sheila King
On 08/12/2005 22:37:22 Bryan Olson <[EMAIL PROTECTED]> wrote: > Sheila King wrote: >> I'm doing DNS lookups [...] it is important to make sure that the socket >> doesn't just hang there waiting for a response. >> After a recent system upgrade to Python 2.4.1 (from 2.2.2) I thought I >> could tak

Re: socket setdefaulttimeout

2005-08-12 Thread Bryan Olson
Sheila King wrote: > I'm doing DNS lookups [...] it is important to make sure > that the socket doesn't just hang there waiting for a response. > > After a recent system upgrade to Python 2.4.1 (from 2.2.2) I thought I > could take advantage of the setdefaulttimeout in the socket module, to >

Re: socket setdefaulttimeout

2005-08-12 Thread Sheila King
I do note that the setdefaulttimeout is accomplishing something in my full program. I am testing some error handling in the code at the moment, and am raising an exception to make the code go into the "except" blocks... The part that sends an error email notice bombed due to socket timeout. (well

socket setdefaulttimeout

2005-08-12 Thread Sheila King
I'm doing DNS lookups on common spam blacklists (such as SpamCop..and others) in an email filtering script. Sometimes, because the DNS server that is resolving the looksup can go down, it is important to make sure that the socket doesn't just hang there waiting for a response. After a recent syste