Close async socket on error (instead of looping on epoll_wait with 100% CPU)

This commit is contained in:
def 2015-01-04 22:59:41 +01:00
commit d60d007281
2 changed files with 8 additions and 1 deletions

View file

@ -878,6 +878,10 @@ else:
let data = PData(info.key.data)
assert data.fd == info.key.fd.TAsyncFD
#echo("In poll ", data.fd.cint)
if EvError in info.events:
closeSocket(data.fd)
continue
if EvRead in info.events:
# Callback may add items to ``data.readCBs`` which causes issues if
# we are iterating over ``data.readCBs`` at the same time. We therefore