这个问题之前在这里被问过: https://networkengineering.stackexchange.com/questions/71813/testing-multicast-problem
但我被指向这里。
我使用这个工具:https://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedmulticast9a.html
关闭 Windows 防火墙并关闭 ESET 安全防火墙。
使用:
C:\2>ipconfig
Windows IP Configuration
Ethernet adapter Połączenie lokalne:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.103
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Ethernet adapter Ethernet 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
C:\2>mcastws1.exe -b 192.168.1.103 -s
socket handle = 0x000000BC
Binding to 192.168.1.103
Joined group: [224.0.0.255]:25000
Set sending interface to: 0.0.0.0
Set multicast ttl to: 8
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
Sent 1024 bytes to [224.0.0.255]:25000
^C
C:\2>
我得到这样的结果:
z:\2>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.102
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
z:\2>mcastws1.exe -b 192.168.1.102
socket handle = 0x00000100
Binding to [192.168.1.102]:25000
Joined group: [224.0.0.255]:25000
Set sending interface to: 0.0.0.0
Set multicast ttl to: 8
^C
z:\2>
问题:为什么我没有得到类似这样的结果: https://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedmulticast9_files/winsock2multicast009.png
答案1
为什么我没有得到类似的结果
第一个例子-s
在命令的末尾有mcastws1.exe
:
mcastws1.exe -b 192.168.1.103 -s
在哪里
-s
是充当服务器(发送数据);否则接收数据
尝试将-s
标志添加到第二个示例中。