How to wait only so long for a server to respond?

Ralph ralph at penguin.com
Wed Apr 3 08:00:03 EST 2002


Sean 'Shaleh' Perry wrote:

> 
> On 03-Apr-2002 Ralph wrote:
>> Pythoners:
>> 
>> I have some code that requests a response from a server on the Internet,
>> but I only want to wait so long for the server to respond.  How can I
>> tell python to wait x seconds/minutes, then move on to the next section
>> of code if the server has not responded?
>> 
>> Thanks as always.
>> 
> 
> a select loop is a common way to wait for data on a socket and specify a
> timeout.  Look for documentation on select().
Sean:

Thanks for the hint.  I'll take a look.

Ralph



More information about the Python-list mailing list