Skip to content

Add support for SO_EXCLUSIVEADDRUSE on Windows #676

Description

@praseodym

On Windows, a socket binding a port without setting SO_EXCLUSIVEADDRUSE can be hijacked by other applications that set the SO_REUSEADDR flag. See the Microsoft documentation "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE".

Unfortunately it looks like there is currently no easy way to set the SO_EXCLUSIVEADDRUSE option in Windows (e.g. rust-lang/rfcs#861), but because of the security impact I think it would be a very useful addition to this crate. I'm open to suggestions on how to implement it in an idiomatic way.

Activity

  1. Thomasdezeeuw commented on Oct 6, 2026

    @Thomasdezeeuw
    Collaborator

    We can add methods similar to reuse_address, but that do the opposite, maybe exclusive_address?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions