0

I am implementing an application intends a socket to join more than multicast group? So, Can a socket join more than one multicast group?

  • 1
    Could you elaborate why you don't want to just create more sockets? – billyswong Dec 13 '12 at 08:33
  • 1
    Possible 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 Answers1

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