问题描述
我正在尝试在 Java 上执行一个简单的多播套接字示例.
I'm trying to execute a simple example of Multicast sockets on Java.
MulticastSocket s = new MulticastSocket(6789);
InetAddress group = InetAddress.getByName("230.1.1.1");
s.joinGroup(group);
此代码生成错误:IP_ADD_MEMBERSHIP failed (out of hardware filters?)
This code generates the error: IP_ADD_MEMBERSHIP failed (out of hardware filters?)
有什么想法吗?
推荐答案
在启用 DHCP Media Sense 功能(默认情况下)时,某些 Windows 机器可能会遇到这种情况.要解决此问题,您可能需要禁用 HDHCP 媒体感应,如下所述:http://support.microsoft.com/kb/239924.
Some Windows machines can experience this when the DHCP Media Sense feature is enabled (it is by default). To address this you may need to disable HDHCP media sensing as described here: http://support.microsoft.com/kb/239924.
如果网络接口不支持多播,也可能发生这种情况.VPN 接口因此而臭名昭著.
It may also happen if the network interface does not support multicast. VPN interfaces are notorious for this.
另外,尝试禁用 TCP/IP 过滤:本地连接属性 > Internet 协议 > 属性 > 高级 > 选项 > 属性 > 禁用启用 TCP/IP 过滤".
Also, try to disable TCP/IP filtering: Local Area Connection Properties > Internet Protocol > Properties > Advanced > Options > Properties > Disable "Enable TCP/IP Filtering".
这篇关于MulticastSocket.joinGroup() 上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!