Message84769
Please correct me, if i'm wrong, but this seems to be a real bug, caused
by people thinking that handle_expt is something like handle_error.
As Tony stated, the docs say that handle_expt is called when out-of-band
data arrives, and that is - i think - correct.
poll, which uses select, calls _exception -> handle_expt_event with fds
from the third set of select. The manpage select_tut(2) has example
code, which has a comment indicating that the third set is supposed to
contain sockets with OOB data.
poll2, however, calls readwrite, which calls handle_expt_event on error
conditions. Furthermore, it calls handle_read_event on POLLPRI, which
(according to the manpage of poll(2)) is supposed to indicate OOB data
when using poll.
Since handle_error is intended for python exceptions, currently there is
no proper method to call on POLLERR and POLLNVAL, unless handle_close is
called. With POLLNVAL, handle_close seems like the correct thing to do
(manpage says it indicates that fd is not open.) With POLLERR, i have no
idea. Manpage says "Error condition", but from that, it's hard to say
whether it refers to a temporary error condition or not.
So, i think readwrite should look something like this:
(Assuming POLLERR -> handle_close, otherwise a new handler would
probably have to be introduced)
if flags & select.POLLPRI:
obj.handle_expt_event()
if flags & select.POLLIN:
obj.handle_read_event()
if flags & select.POLLOUT:
obj.handle_write_event()
if flags & (select.POLLERR | select.POLLNVAL | select.POLLHUP):
obj.handle_close() |
|
Date |
User |
Action |
Args |
2009-03-31 12:37:38 | alexer | set | recipients:
+ alexer, tim.peters, akuchling, brett.cannon, gregory.p.smith, anadelonbrin, josiahcarlson, giampaolo.rodola, ajaksu2 |
2009-03-31 12:37:38 | alexer | set | messageid: <1238503058.31.0.233097368088.issue1161031@psf.upfronthosting.co.za> |
2009-03-31 12:37:37 | alexer | link | issue1161031 messages |
2009-03-31 12:37:36 | alexer | create | |
|