thanks! I try the "try" before, but can't catch the socket error. so strange, maybe my code was error. I wrote a retry code block as below. import httplib,time while 1: try: conn = httplib.HTTPConnection("www.test.com") conn.request("GET", "/") print "success" break except: print "error" time.sleep(2)