From 48d0b1e73172942cc6e35572708bdb1290e0cef2 Mon Sep 17 00:00:00 2001 From: Peter Tribble Date: Thu, 20 Jun 2024 08:08:11 +0100 Subject: [PATCH 1/2] Use cythonized SO_REUSEPORT rather than the unwrapped native one. Fixes #550 --- uvloop/loop.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx index 334d8d50..de88b575 100644 --- a/uvloop/loop.pyx +++ b/uvloop/loop.pyx @@ -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. From 91bf31efb9598105d1873c15d067349edcc251eb Mon Sep 17 00:00:00 2001 From: Fantix King Date: Thu, 15 Aug 2024 16:16:17 -0400 Subject: [PATCH 2/2] Drop uv.SO_REUSEPORT --- uvloop/includes/uv.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uvloop/includes/uv.pxd b/uvloop/includes/uv.pxd index 87651306..2756a306 100644 --- a/uvloop/includes/uv.pxd +++ b/uvloop/includes/uv.pxd @@ -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