Skip to content

Commit

Permalink
Make SO_REUSEADDR the default for TCP sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
badeend committed Jan 3, 2024
1 parent fce7fe7 commit f6e12a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,10 @@ implicitly bind the socket.</p>
<li><code>not-in-progress</code>: A <code>bind</code> operation is not in progress.</li>
<li><code>would-block</code>: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)</li>
</ul>
<h1>Implementors note</h1>
<p>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).</p>
<h1>References</h1>
<ul>
<li><a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html">https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html</a></li>
Expand Down
5 changes: 5 additions & 0 deletions wit/tcp.wit
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ interface tcp {
/// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL)
/// - `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
/// - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html>
Expand Down

0 comments on commit f6e12a1

Please sign in to comment.