I want to send some messages to other machines by using UDP protocol in Java. And I knew my ip address and the broadcast address it should advertise on. Like my ip address is 127.0.0.1, and the I the other address is 127.0.0.200. I want to broadcast the message to machines with addresses from 127.0.0.1 to 127.0.0.200. How to implement this in Java?
And the range of ip address may be 127.0.0.1 to 127.1.4.80.
I am a beginner and I just know I should use InetAddress type to express the ip address. But I don't know how to iterate all the InetAddress objects.
Could someone help me?
Thanks a lot!!