From f6e12a1f4ec964a8fdb4efd7a0e7c8dfadbf9057 Mon Sep 17 00:00:00 2001 From: Dave Bakker Date: Wed, 3 Jan 2024 10:49:05 +0100 Subject: [PATCH 1/2] Make SO_REUSEADDR the default for TCP sockets --- imports.md | 4 ++++ wit/tcp.wit | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/imports.md b/imports.md index 497f48d..f0fa5c3 100644 --- a/imports.md +++ b/imports.md @@ -1190,6 +1190,10 @@ implicitly bind the socket.

  • not-in-progress: A bind operation is not in progress.
  • would-block: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)
  • +

    Implementors note

    +

    When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT +state of a recently closed socket on the same local address (i.e. the SO_REUSEADDR socket +option should be set implicitly on platforms that require it).

    References

    Implementors note

    When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT -state of a recently closed socket on the same local address (i.e. the SO_REUSEADDR socket -option should be set implicitly on platforms that require it).

    +state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR +socket option should be set implicitly on all platforms, except on Windows where this is the default behavior +and SO_REUSEADDR performs something different entirely.

    References