fix issue 658749: correctly interprets asyncore's windows errors on connect()
This commit is contained in:
parent
0538064554
commit
76fc8c7098
|
@ -53,7 +53,7 @@ import time
|
|||
import warnings
|
||||
|
||||
import os
|
||||
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
|
||||
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
|
||||
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode
|
||||
|
||||
try:
|
||||
|
@ -337,8 +337,8 @@ class dispatcher:
|
|||
def connect(self, address):
|
||||
self.connected = False
|
||||
err = self.socket.connect_ex(address)
|
||||
# XXX Should interpret Winsock return values
|
||||
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK):
|
||||
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
|
||||
or err == EINVAL and os.name in ('nt', 'ce'):
|
||||
return
|
||||
if err in (0, EISCONN):
|
||||
self.addr = address
|
||||
|
|
Loading…
Reference in New Issue