Skip to content

Does not work with clustering. #304

Answered by adelyte-chris
Phara0h asked this question in Q&A
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

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
Comment options

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

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