Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Jean-Paul Calderone
On Tue, 17 Mar 2009 18:03:59 +0100, Laszlo Nagy wrote: For whatever reason, you're ending up with a lot of open files and/or sockets (and/or any other resource based on file descriptors). That results in new file descriptors having large values (>=1024). You cannot use select() with such fi

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Laszlo Nagy
For whatever reason, you're ending up with a lot of open files and/or sockets (and/or any other resource based on file descriptors). That results in new file descriptors having large values (>=1024). You cannot use select() with such file descriptors. Try poll() instead, or Twisted. ;) Poll

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Laszlo Nagy
Here's an interesting post: http://mail.python.org/pipermail/python-list/2005-April/317442.html Thank you. I'll try socket.close() instead of socket.shutdown(). Or both. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread MRAB
Laszlo Nagy wrote: Hi Laszlo, Just a hunch -- are you leaking file handles and eventually running out? These file handles are for TCP sockets. They are accept()-ed, used and then thrown out. I guess after the connection was closed, the file handle is destroyed automatically. BTW here is the

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Richard Brodie
"Laszlo Nagy" wrote in message news:mailman.2032.1237300298.11746.python-l...@python.org... > This method is called after the connection has been closed. Is is possible > that somehow > the file handles are leaking? If I understand correctly, you call shutdown() but not close() in response t

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Philip Semanchuk
On Mar 17, 2009, at 10:31 AM, Laszlo Nagy wrote: Hi Laszlo, Just a hunch -- are you leaking file handles and eventually running out? These file handles are for TCP sockets. They are accept()-ed, used and then thrown out. I guess after the connection was closed, the file handle is destr

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Jean-Paul Calderone
local/www/vhosts/shopzeus.com/fantasy/sorb/endpoint.py", line 344, in read_data ready = select.select([fd], [], [], 0.2) ValueError: filedescriptor out of range in select() For whatever reason, you're ending up with a lot of open files and/or sockets (and/or any other resourc

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Laszlo Nagy
Hi Laszlo, Just a hunch -- are you leaking file handles and eventually running out? These file handles are for TCP sockets. They are accept()-ed, used and then thrown out. I guess after the connection was closed, the file handle is destroyed automatically. BTW here is the shutdown() method fo

Re: ValueError: filedescriptor out of range in select()

2009-03-17 Thread Philip Semanchuk
lf.read_data(8))[0] File "/usr/local/www/vhosts/shopzeus.com/fantasy/sorb/endpoint.py", line 344, in read_data ready = select.select([fd], [], [], 0.2) ValueError: filedescriptor out of range in select() Hi Laszlo, Just a hunch -- are you leaking file handles and eventually running out? -- http://mail.python.org/mailman/listinfo/python-list

ValueError: filedescriptor out of range in select()

2009-03-17 Thread Laszlo Nagy
osts/shopzeus.com/fantasy/sorb/endpoint.py", line 344, in read_data ready = select.select([fd], [], [], 0.2) ValueError: filedescriptor out of range in select() The code for read_data: def read_data(self,size): res = "" fd = self.socket.fileno() while not s