In a discussion on SO_REUSEPORT, the following question was posted to reddit, but there was no answer. I am wondering if Stack Overflow knows the answer.
Can anyone tell me how this interacts with multicast?
I've got an application where the program should listen to multicast UDP messages, and this program may be started multiple times on the same computer. When a message comes it, all listening processes should get it.
I've noticed that on Linux, it works fine if I don't set SO_REUSEPORT, and if I understand correctly, setting SO_REUSEPORT may be the wrong thing to do -- I don't want UDP messages distributed between the processes, I want all processes to get a copy. However, on OS X, the second execution of the program fails to find a free port unless SO_REUSEPORT is set.
tl;dr: Is it expected to set SO_REUSEPORT when using multicast?