Thanks, however, I forgot to mention that I'm using windows, and from what I've tried, the setdefaulttimeout function doesn't work on my machine. Again, thanks for your help! Brandon McGinty
> -----Original Message----- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Rene Pijlman > Sent: Sunday, March 19, 2006 5:33 PM > To: python-list@python.org > Subject: Re: Keeping a function from taking to long--threads? > > > <[EMAIL PROTECTED]>: > >Just wondering if anyone knows of a way to keep a function, > >E.g. socket.gethostbyaddr("12.34.56.78"), > >>From taking to long-if it's run for more than 1 second, the function > >gethostbyaddr will be terminated? > > import socket > socket.setdefaulttimeout(1) > > -- > René Pijlman > > Wat wil jij leren? http://www.leren.nl > -- > http://mail.python.org/mailman/listinfo/python-list > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.385 / Virus Database: 268.2.5/284 - Release > Date: 3/17/2006 > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.2.5/284 - Release Date: 3/17/2006 -- http://mail.python.org/mailman/listinfo/python-list