[New-bugs-announce] [issue16594] SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present

Andy Zeldis report at bugs.python.org
Sun Dec 2 10:07:29 CET 2012


New submission from Andy Zeldis:

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)

----------
components: Library (Lib)
files: osc-broadcast-rcv.py
messages: 176777
nosy: Andy.Zeldis
priority: normal
severity: normal
status: open
title: SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28183/osc-broadcast-rcv.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16594>
_______________________________________


More information about the New-bugs-announce mailing list