EXTERNAL: OSError: [Errno 48] Address already in use

Grant Edwards grant.b.edwards at gmail.com
Tue Jul 3 10:55:05 EDT 2018

On 2018-07-03, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> On 2018-07-03, Grant Edwards <grant.b.edwards at gmail.com> wrote:
>> On 2018-07-01, Marko Rauhamaa <marko at pacujo.net> wrote:
>>> Gregory Ewing <greg.ewing at canterbury.ac.nz>:
>>>> I don't see how the address-reuse timeout can be a security measure,
>>>> because the process trying to take over the address can easily
>>>> circumvent it by setting SO_REUSEADDR.
>>> [...]
>>> Nevertheless, the later socket object cannot unilaterally take over a
>>> socket using SO_REUSEADDR. The earlier socket object must have set the
>>> same option previously.
>> On what OS?  In my experience, that's not true on Linux or BSD Unix.
> I was wrong.  I just did a quick test on Linux, and it works the way
> Marko Hauhamaa describes.

Um that was supposed to be Rauhamaa... sorry about that.

> [Don't have handy access to a BSD system at the moment.]

Found a NetBSD 7.1 system to test on...

After killing a server with an active connection, a new server can
bind to the same socket regardless of the SO_REUSEADDR setting in
either server.  I don't know if that's some sort of system
configuration setting or what...

Grant Edwards               grant.b.edwards        Yow! Where's the Coke
                                  at               machine?  Tell me a joke!!

More information about the Python-list mailing list