mirror of https://github.com/MagicStack/uvloop.git
win: Use socket.dup() on Windows
This commit is contained in:
parent
9a85c1431c
commit
c2defd0359
|
@ -58,6 +58,17 @@ cdef _is_sock_dgram(sock_type):
|
||||||
return (sock_type & 0xF) == uv.SOCK_DGRAM
|
return (sock_type & 0xF) == uv.SOCK_DGRAM
|
||||||
|
|
||||||
|
|
||||||
|
cdef __dup(sock):
|
||||||
|
# cross-platform duping
|
||||||
|
IF UNAME_SYSNAME == "Windows":
|
||||||
|
dup_sock = sock.dup()
|
||||||
|
fileno = dup_sock.fileno()
|
||||||
|
dup_sock.detach()
|
||||||
|
return fileno
|
||||||
|
ELSE:
|
||||||
|
return os_dup(sock.fileno())
|
||||||
|
|
||||||
|
|
||||||
cdef isfuture(obj):
|
cdef isfuture(obj):
|
||||||
if aio_isfuture is None:
|
if aio_isfuture is None:
|
||||||
return isinstance(obj, aio_Future)
|
return isinstance(obj, aio_Future)
|
||||||
|
|
Loading…
Reference in New Issue