I noticed how routers can send a broadcast packet within an area to allow a wireless network connection and therefore network access. My question is: how can we implement something like this in java? I know how I can "UDP Broadcast", but this is not the type of broadcast that I want to do.
import java.net.*;
class Broadcast{
public static void main(String[] args){
DatagramSocket broadcastserver = new DatagramSocket(80);
broadcastserver.setBroadcast(true);
...
...
In conclusion, instead of broadcasting on a port such as UDP broadcasting, you can achieve how we can broadcast in areas like what the router can do.
source
share