Sending packets to 255.255.255.255 by Java DatagramSocket fails

前端 未结 4 1476
傲寒
傲寒 2020-12-11 01:55

I\'m programming a networking program in java , and I want to send some Packets to 255.255.255.255, but it fails , even when I send them to 192.168.1.255, which according to

4条回答
  •  轮回少年
    2020-12-11 02:19

    If I remember correctly, you cannot receive from broadcast-adresses, but only send to them! So on the receiving side, you must be listening on "your" IP specifically.

提交回复
热议问题