Use cythonized SO_REUSEPORT rather than the unwrapped native one. (#609)

Fixes #550

Co-authored-by: Fantix King <fantix.king@gmail.com>
This commit is contained in:
Peter Tribble 2024-08-16 01:14:19 +01:00 committed by GitHub
parent 2d35f106d3
commit 4083a94e5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ cdef extern from "uv.h" nogil:
cdef int SOL_SOCKET cdef int SOL_SOCKET
cdef int SO_ERROR cdef int SO_ERROR
cdef int SO_REUSEADDR 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_INET
cdef int AF_INET6 cdef int AF_INET6
cdef int AF_UNIX cdef int AF_UNIX

View File

@ -1775,7 +1775,7 @@ cdef class Loop:
if reuse_address: if reuse_address:
sock.setsockopt(uv.SOL_SOCKET, uv.SO_REUSEADDR, 1) sock.setsockopt(uv.SOL_SOCKET, uv.SO_REUSEADDR, 1)
if reuse_port: 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 # Disable IPv4/IPv6 dual stack support (enabled by
# default on Linux) which makes a single socket # default on Linux) which makes a single socket
# listen on both address families. # listen on both address families.