Paul Rubin writes:
> Chris Angelico writes:
>> Yeah, I figured fileno() probably wouldn't be news to you. I don't
>> suppose there's anything convenient in the rest of your application
>> that makes such a list/dict plausible?
>
> In fact it's rather annoying, sockets are created and destroyed
Chris Angelico writes:
> Yeah, I figured fileno() probably wouldn't be news to you. I don't
> suppose there's anything convenient in the rest of your application
> that makes such a list/dict plausible?
In fact it's rather annoying, sockets are created and destroyed in
multiple places in the pro
On Fri, Feb 8, 2013 at 3:15 AM, Paul Rubin wrote:
> Chris Angelico writes:
>> fd_to_sock={sock.fileno():sock for sock in list_of_sockets}
>> You'd need to manually maintain that as sockets get created/destroyed,
>> though
>
> Thanks, I was hoping to avoid that. I'll have to check how
> select.se
Chris Angelico writes:
> fd_to_sock={sock.fileno():sock for sock in list_of_sockets}
> You'd need to manually maintain that as sockets get created/destroyed,
> though
Thanks, I was hoping to avoid that. I'll have to check how
select.select manages to return sockets. Maybe it builds such a dict
On Thu, Feb 7, 2013 at 6:08 PM, Paul Rubin wrote:
> Any idea of a good way to map the file descriptors back to socket
> objects? Is there some kind of hidden interface that I don't know
> about, that gives back sockets directly?
I don't know of any, but you can get the file descriptor from a soc
I'm trying to listen to a bunch of sockets using epoll under Linux, e.g.
import select, socket
socket1 = socket.socket() ...
p = select.epoll()
p.register(socket1); p.register(socket2); ...
result = p.poll()
This returns `result' as a list of 2-tuples (fd, status) where fd
is a Li