Skip to content

Commit

Permalink
Use cythonized SO_REUSEPORT rather than the unwrapped native one. (#609)
Browse files Browse the repository at this point in the history
Fixes #550

Co-authored-by: Fantix King <[email protected]>
  • Loading branch information
ptribble and fantix authored Aug 16, 2024
1 parent 2d35f10 commit 4083a94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uvloop/includes/uv.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ cdef extern from "uv.h" nogil:
cdef int SOL_SOCKET
cdef int SO_ERROR
cdef int SO_REUSEADDR
cdef int SO_REUSEPORT
# use has_SO_REUSEPORT and SO_REUSEPORT in stdlib.pxi instead
cdef int AF_INET
cdef int AF_INET6
cdef int AF_UNIX
Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ cdef class Loop:
if reuse_address:
sock.setsockopt(uv.SOL_SOCKET, uv.SO_REUSEADDR, 1)
if reuse_port:
sock.setsockopt(uv.SOL_SOCKET, uv.SO_REUSEPORT, 1)
sock.setsockopt(uv.SOL_SOCKET, SO_REUSEPORT, 1)
# Disable IPv4/IPv6 dual stack support (enabled by
# default on Linux) which makes a single socket
# listen on both address families.
Expand Down

0 comments on commit 4083a94

Please sign in to comment.