java收不到udp广播包_Java上的UDP广播不起作用

好的,我找到了答案。 Windows 7不再支持255.255.255.255广播,显然它是对各种威胁的开放。要进行广播,需要使用不同的方法。

这是维基百科的一个小型表达:

The broadcast address for an IPv4 host can be obtained by performing a bitwise logical OR operation between the bit complement of the subnet mask and the host's IP address.

Example: to broadcast a packet to an entire IPv4 subnet using the private IP address space 100.16.0.0/12, which has the subnet mask 255.240.0.0, the broadcast address is: 100.16.0.0 | 0.15.255.255 = 100.31.255.255.

A special definition exists for the IP broadcast address 255.255.255.255. It is the broadcast address of the zero network or 0.0.0.0, which in Internet Protocol standards stands for this network, i.e. the local network. Transmission to this address is limited by definition, in that it is never forwarded by the routers connecting the local network to the Internet.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值