Q: socket error in multi-threaded urlopen
Seung-won Hwang
shwang5 at students.uiuc.edu
Tue May 8 17:42:08 EDT 2001
Hello,
I'm trying to call urlopen using multiple threads and it gives me the
following errors. I'm experimenting if I can
call hundreds of 'urlopen' calls simulataneously. Is there any way to get
around this 'too many open files' problem in doing so?
Thanks,
Seung-won
--
Exception in thread Thread-24:
Traceback (most recent call last):
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/threading.py"
, line 376, in __bootstrap
File "overload.py", line 20, in run
File "overload.py", line 27, in num_hits
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/urllib.py", l
ine 61, in urlopen
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/urllib.py", l
ine 166, in open
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/urllib.py", l
ine 273, in open_http
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/httplib.py",
line 425, in putrequest
self.send(str)
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/httplib.py",
line 367, in send
self.connect()
File
"/usr/dcs/software/supported/encap/python-2.0/lib/python2.0/httplib.py",
line 348, in connect
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
IOError: [Errno socket error] (24, 'Too many open files')
More information about the Python-list
mailing list