Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38335
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Paul Rubin <no.email@nospam.invalid> |
| Newsgroups | comp.lang.python |
| Subject | select.epoll question |
| Date | Wed, 06 Feb 2013 23:08:24 -0800 |
| Organization | Nightsong/Fort GNOX |
| Lines | 25 |
| Message-ID | <7xbobw1tzr.fsf@ruckus.brouhaha.com> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx05.eternal-september.org; posting-host="d94d289a4df6ae47ea4d4f8b2ae808e7"; logging-data="2476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dGhM+nG246kLKyNGp3Ies" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:F87562YELNyhu/Q45dUJdFVtVrE= sha1:QMapMB2ARSU/xZ80WPixdXmCVRc= |
| Xref | csiph.com comp.lang.python:38335 |
Show key headers only | View raw
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 Linux file descriptor, i.e. a small integer like comes back from socket.fileno(). That's different from select.select, which returns a list of actual socket objects that I can read from with socket.recv(). 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? The docs for epoll in select.html don't seem very good. I haven't yet examined the source code. Thanks for any advice. --Paul
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-06 23:08 -0800
Re: select.epoll question Chris Angelico <rosuav@gmail.com> - 2013-02-07 23:49 +1100
Re: select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-07 08:15 -0800
Re: select.epoll question Chris Angelico <rosuav@gmail.com> - 2013-02-08 03:24 +1100
Re: select.epoll question Paul Rubin <no.email@nospam.invalid> - 2013-02-07 12:19 -0800
Re: select.epoll question Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2013-02-08 07:36 +0530
csiph-web