Subscribing to multiple multicast groups on one socket (Linux, C)

前端 未结 6 1521
悲哀的现实
悲哀的现实 2020-12-31 15:29

Is it possible to receive data from more than one multicast group on a single socket?

For example:

void AddGroup(int sock,
              const char*          


        
6条回答
  •  梦毁少年i
    2020-12-31 16:04

    You can join as many multicast groups you want to on a single socket. See setsockopt(), IP_PKTINFO for a way to recognize which multicast group you are reading data from.

提交回复
热议问题