You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present #60798
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-12-13.13:33:49.165>created_at=<Date2012-12-02.09:07:29.427>labels= ['type-bug', 'library', '3.11']
title='SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present'updated_at=<Date2021-12-13.13:33:49.164>user='https://bugs.python.org/AndyZeldis'
On BSD (including Mac OS X) SO_REUSEPORT should be specified along with SO_REUSEADDR to match behavior on Linux (and possible Windows). This is needed to have multiple listeners to a UDP broadcast.
I discovered this when using PyOSC. Attached is an example modified to subclass SocketServer with a workaround. It should be possible to start multiple instances of this program, all of which will receive messages to a broadcast address (eg 255.255.255.255:7110).
This test uses Python 2.7 on OS X (despite the "python3" shebang line from the example)
Activity
AndyZeldis commentedon Dec 2, 2012
On BSD (including Mac OS X) SO_REUSEPORT should be specified along with SO_REUSEADDR to match behavior on Linux (and possible Windows). This is needed to have multiple listeners to a UDP broadcast.
I discovered this when using PyOSC. Attached is an example modified to subclass SocketServer with a workaround. It should be possible to start multiple instances of this program, all of which will receive messages to a broadcast address (eg 255.255.255.255:7110).
This test uses Python 2.7 on OS X (despite the "python3" shebang line from the example)
gvanrossum commentedon Dec 3, 2013
Note: it is possible that SO_REUSEPORT is defined yet not implemented (and you'll get an OSError when using it).
asvetlov commentedon Dec 13, 2021
New changeset b56774b by AN Long in branch 'main':
bpo-16594: Add allow_reuse_port on socketserver (GH-30072)
b56774b