Skip to content

Port/Address re-use #2011

Closed
Closed
@Frank-Friemel

Description

@Frank-Friemel

setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,

Hi, I think there is a bug in the above line. This does not work. The return value is -1. I guess because you've previously enabled address re-use. Just applying SO_EXCLUSIVEADDRUSE (without SO_REUSEADDR) works.

I mean ... what is the purpose at all? In the Linux path you enable address/port re-usage. And in the Win32 path you try to disable it by acquiring the port exclusively? Currently it's enabled for both platforms, because SO_EXCLUSIVEADDRUSE fails. I stumbled over this because for my project this behaviour was kind of unexpected. My expectation was that a port can only be bound by one application/process/thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions