Commit 0abc64d7 authored by Josiah Carlson's avatar Josiah Carlson

This fixes bug 5798 on OS X.

This should also fix disconnect behavior cross-platform.
parent b1614a7b
...@@ -100,10 +100,15 @@ def readwrite(obj, flags): ...@@ -100,10 +100,15 @@ def readwrite(obj, flags):
obj.handle_read_event() obj.handle_read_event()
if flags & select.POLLOUT: if flags & select.POLLOUT:
obj.handle_write_event() obj.handle_write_event()
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
obj.handle_close()
if flags & select.POLLPRI: if flags & select.POLLPRI:
obj.handle_expt_event() 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: except _reraised_exceptions:
raise raise
except: except:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment