Windows asyncore error handler fix

- WSAEWOULDBLOCK is now checked on connect and accept
This commit is contained in:
Peter Šurda 2017-08-06 18:18:21 +02:00
parent 8f14fb05a1
commit 5108d08ac9
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -550,7 +550,7 @@ class dispatcher:
self.connected = False self.connected = False
self.connecting = True self.connecting = True
err = self.socket.connect_ex(address) err = self.socket.connect_ex(address)
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \ if err in (EINPROGRESS, EALREADY, EWOULDBLOCK, WSAEWOULDBLOCK) \
or err == EINVAL and os.name in ('nt', 'ce'): or err == EINVAL and os.name in ('nt', 'ce'):
self.addr = address self.addr = address
return return
@ -567,7 +567,7 @@ class dispatcher:
except TypeError: except TypeError:
return None return None
except socket.error as why: except socket.error as why:
if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN, ENOTCONN): if why.args[0] in (EWOULDBLOCK, WSAEWOULDBLOCK, ECONNABORTED, EAGAIN, ENOTCONN):
return None return None
else: else:
raise raise