timeoutsocket won't timeout

Dan Polak systhree at nospam.mailandnews.com
Sat May 11 13:42:19 EDT 2002


For the life of me I can't figure out why timeoutsocket (version 1.23) 
will not timeout here.
Any ideas?

Dan

#!/usr/local/bin/python

import socket, timeoutsocket

timeoutsocket.setDefaultSocketTimeout(1)

hostname = ""
print "getting hostname for " + address
try:
		(hostname, more, ip) = socket.gethostbyaddr
('63.211.210.20')
except socket.error:
	# lookup failed
	pass

if hostname <> "":
	print hostname
else:	
	print 'no hostname found'



More information about the Python-list mailing list