UDP通信实例(3)

您所在的位置:网站首页 生物中udp是什么意思啊 UDP通信实例(3)

UDP通信实例(3)

2024-07-04 10:32| 来源: 网络整理| 查看: 265

按照https://blog.csdn.net/lucky_greenegg/article/details/84938565 的说法,结合https://docs.microsoft.com/zh-cn/windows/desktop/WinSock/ip-multicast-2 的描述,

The Winsock version of the IP_MULTICAST_LOOP option is semantically different than the UNIX version of the IP_MULTICAST_LOOP option:

In Winsock, the IP_MULTICAST_LOOP option applies only to the receive path.In the UNIX version, the IP_MULTICAST_LOOP option applies to the send path.

For example, applications ON and OFF (which are easier to track than X and Y) join the same group on the same interface; application ON sets the IP_MULTICAST_LOOP option on, application OFF sets the IP_MULTICAST_LOOP option off. If ON and OFF are Winsock applications, OFF can send to ON, but ON cannot sent to OFF. In contrast, if ON and OFF are UNIX applications, ON can send to OFF, but OFF cannot send to ON.

我把回环组播的理解画出来讲解下:

对于unix系统,实现阻断的办法是阻断发送:

对于windows,实现阻断靠的是阻断接收:

假如在同一台计算机上有两个应用程序,并且加入了同一个组播。这两个程序,一个允许回环,一个阻断回环,则会有如下现象:

windows下,允许方不能发向阻断方,但阻断方可以发向允许方;

linux下,允许方可以发向阻断方,但阻断方不能发向允许方。

 

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3