uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 267 forks source link

MacOS seems to require SO_REUSEPORT just like Linux. #138

Closed baldvin-kovacs closed 3 years ago

baldvin-kovacs commented 3 years ago

Hello,

I have tried running multiple threads as you describe in the docs, but without this change, it wasn't willing to do it on my Mac.

I don't know if this is a change in how MacOS works, or it was always the case that uWebsockets only worked on 1 thread.

Let me know what you think about adding this little change. Thank you, Baldvin

ghost commented 3 years ago

This socket option is not the same as on Linux. They have the same name but different behavior.

What you want is more like FreeBSD SO_REUSEPORT_LB but that's not available on macOS

baldvin-kovacs commented 3 years ago

Oh, wow! Thank you for the information, and sorry for wasting your time with this. 1 thread for MacOS then :)