socket programming

gry at ll.mit.edu gry at ll.mit.edu
Wed Jul 20 09:20:16 EDT 2005


What I have done in similar circumstances is put in a random sleep
between connections to fool the server's load manager.  Something like:

.import time
.min_pause,max_pause = (5.0, 10.0) #seconds
.while True:
.   time.sleep(random.uniform(min_pause, max_pause))
.   do_connection_and_query_stuff()

It works for me.  Just play with the pause parameters until it fails
and add a little.

-- George




More information about the Python-list mailing list