Skip to content
Discussion options

You must be logged in to vote

From the path in your stack trace, it seems you're using macOS.

Your example code omits two important lines:

/* This example spawns two worker threads, each with their own
 * server listening to the same port (Linux feature). */

Note the "Linux feature" parenthetical remark.

@alexhultman can confirm, but I believe SO_REUSEPORT on Linux uniquely supports (as of 3.9) TCP and UDP sockets, whereas SO_REUSEPORT on macOS only supports UDP sockets. macOS does not know what to do with two threads that request to be bound to the same TCP port.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@johnsonfash
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #304 on December 09, 2020 05:28.