Message303035
It would help to look how Twisted, eventlet, gevent and others handle "urgent data" and "exceptions". Check if they succeeded to formalize these events.
asyncore uses select() or poll().
asyncore.poll() uses select.select(). It adds the fd to exceptfds if the fd is in the readfds or writefds, then asyncore calls _exception():
r = []; w = []; e = []
for fd, obj in map.items():
is_r = obj.readable()
is_w = obj.writable()
(...)
if is_r or is_w:
e.append(fd)
(...)
try:
r, w, e = select.select(r, w, e, timeout)
except select.error, err:
(...)
(...)
for fd in e:
obj = map.get(fd)
if obj is None:
continue
_exception(obj)
asyncore.poll2() uses select.poll(). It only uses POLLPRI if the fd is readable but always checks for error condition (POLLERR) (if asyncio waits for read and/or write events):
for fd, obj in map.items():
flags = 0
if obj.readable():
flags |= select.POLLIN | select.POLLPRI
# accepting sockets should not be writable
if obj.writable() and not obj.accepting:
flags |= select.POLLOUT
if flags:
# Only check for exceptions if object was either readable
# or writable.
flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL
pollster.register(fd, flags) |
|
Date |
User |
Action |
Args |
2017-09-26 12:13:26 | vstinner | set | recipients:
+ vstinner, pitrou, neologix, yselivanov, pklanke |
2017-09-26 12:13:26 | vstinner | set | messageid: <1506428006.24.0.821361150906.issue30844@psf.upfronthosting.co.za> |
2017-09-26 12:13:26 | vstinner | link | issue30844 messages |
2017-09-26 12:13:26 | vstinner | create | |
|