I am implementing an application intends a socket to join more than multicast group? So, Can a socket join more than one multicast group?
Asked
Active
Viewed 2,575 times
0
-
1Could you elaborate why you don't want to just create more sockets? – billyswong Dec 13 '12 at 08:33
-
1Possible duplicate of [Subscribing to multiple multicast groups on one socket (Linux, C)](https://stackoverflow.com/questions/9243292/subscribing-to-multiple-multicast-groups-on-one-socket-linux-c) – tstenner Aug 06 '19 at 12:14
1 Answers
0
see this question and the answers provided therein: Subscribing to multiple multicast groups on one socket (Linux, C)
The longer answer is: yes, you can, using the appropriate setsockopt() call with the IP_ADD_MEMBERSHIP option (quote: https://stackoverflow.com/a/9258030/1284631)

Community
- 1
- 1

user1284631
- 4,446
- 36
- 61
-
-
1@user1680544 It doesn't make any difference whether you bind on `INADDR_ANY`, unless some of the multicast groups require non-standard routine. – user207421 Dec 13 '12 at 09:49
-