之前在这里问过这个问题: 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
为什么我没有得到类似的结果
您的第一个示例
-s
在命令末尾有mcastws1.exe
:在哪里
来源:Windows socket 的 IPv4 多播编程教程
尝试将
-s
标志添加到您的第二个示例中。