A strange questions, about socket.py

Chaojie He otkcreed at gmail.com
Thu Dec 27 11:48:17 CET 2012


Code:
import urllib2 , socks , socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,'127.0.0.1',1080,True,None,None)
socket.socket = socks.socksocket
result = urllib2.urlopen("http://www.youtube.com",timeout=5)

If in the operation process of the server disconnected, the script will enter circulation state.

Log(The last part):
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))
socks.py(140): 		while len(data) < bytes:
socks.py(141): 			data = data + self.recv(bytes-len(data))



More information about the Python-list mailing list