多播侦听器接受另一个端口上的套接字

时间:2021-03-09 18:14:39

I have a multicast listener in C that is listening on 229.0.0.1, however is accepting UDP sockets destined for 224.0.0.1.

我在C中有一个正在侦听229.0.0.1的多播侦听器,但是它正在接受发往224.0.0.1的UDP套接字。

Can someone explain why this is occurring?

有人可以解释为什么会这样吗?

The process is bound (server) to INADDR_ANY, and the multicast struct is specified as 229.0.0.1; shouldn't my "server" process drop UDP datagrams that are not selected for anything other than what was explicitly configured?

进程绑定(服务器)为INADDR_ANY,组播结构指定为229.0.0.1;不应该我的“服务器”进程丢弃除了显式配置之外的任何其他内容未选择的UDP数据报吗?

1 个解决方案

#1


2  

224.0.0.1 is a reserved multicast address for addressing all hosts on the local segment. All network interfaces are always listening on this multicast address.

224.0.0.1是保留的多播地址,用于寻址本地段上的所有主机。所有网络接口始终在侦听此多播地址。

So if a packet is sent to 224.0.0.1 on the port your application is using, your app will receive the packet whether you asked to listen to that particular multicast address or not.

因此,如果在您的应用程序正在使用的端口上将数据包发送到224.0.0.1,则无论您是否要求侦听该特定多播地址,您的应用都将收到该数据包。

#1


2  

224.0.0.1 is a reserved multicast address for addressing all hosts on the local segment. All network interfaces are always listening on this multicast address.

224.0.0.1是保留的多播地址,用于寻址本地段上的所有主机。所有网络接口始终在侦听此多播地址。

So if a packet is sent to 224.0.0.1 on the port your application is using, your app will receive the packet whether you asked to listen to that particular multicast address or not.

因此,如果在您的应用程序正在使用的端口上将数据包发送到224.0.0.1,则无论您是否要求侦听该特定多播地址,您的应用都将收到该数据包。