This fixes bug 5798 on OS X.

This should also fix disconnect behavior cross-platform.
This commit is contained in:
Josiah Carlson 2009-06-03 19:48:02 +00:00
parent b1614a7b67
commit 0abc64d719
1 changed files with 7 additions and 2 deletions

View File

@ -100,10 +100,15 @@ def readwrite(obj, flags):
obj.handle_read_event()
if flags & select.POLLOUT:
obj.handle_write_event()
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
obj.handle_close()
if flags & select.POLLPRI:
obj.handle_expt_event()
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
obj.handle_close()
except socket.error as e:
if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
obj.handle_error()
else:
obj.handle_close()
except _reraised_exceptions:
raise
except: