UDP: Listening to the same port for two different multicast streams

前端 未结 4 777
无人及你
无人及你 2021-01-01 03:16

I need to listen to 2 different multicast groups using the same port. Program A will listen from 230.0.0.1 and Program B from 23

4条回答
  •  失恋的感觉
    2021-01-01 03:54

    "connect" might be what you need after all. Typically, for connecting TCP sockets, the man page also suggests that it can be used for filtering out UDP packets from other addresses:

    From the man page posted here:

    If the socket sockfd is of type SOCK_DGRAM then addr is the address to which datagrams are sent by default, and the only address from which datagrams are received.

提交回复
热议问题