Java udp broadcast problem?

Change that 2nd argument to null, or omit it. You don't care which IP address you receive datagrams from.

DatagramSocket sr = new DatagramSocket(port, InetAddress.getLocalHost()); Change that 2nd argument to null, or omit it. You don't care which IP address you receive datagrams from. P.

SetAddress(InetAddress. GetByAddress(new byte { (byte) 255, (byte) 255, (byte) 255, (byte) 255 })); Broadcast to 255.255.255.255 has been deprecated for about 20 years. Use a subnet-specific broadcast address.

Better still, investigate multicast.

UDP requests are often restricted to the current subnet (unless you gateway passes then onwards which is unusual). So this is one issue. The machine not getting any UDP requests could also have a local firewall that is blocking it too.

No firewalls, but machine A is connected to several networks(192.168.0.123/24, 192.168.159.17/24, etc. ) and machine B is connected to several networks, but they are directly visible so no router are involved – misha nesterenko Apr 7 at 23:26 I think you need to use Multicast Socket's and use groups... have a look @ codeproject. Com/KB/IP/multicast. Aspx – spgennard Apr 7 at 23:42.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions