I need to know if there is any class (s) that can get properties from the connections of the devices connected to the modem network.
I need to know if there is any class (s) that can get properties from the connections of the devices connected to the modem network.
It is not very clear to me what you intend to do but I leave you a code that goes through the network connections and shows you the ips of the computers connected at the moment under a range of ips
public void checkHosts(String subnet){
int timeout=1000;
for (int i=1;i<255;i++){
String host=subnet + "." + i;
if (InetAddress.getByName(host).isReachable(timeout)){
System.out.println(host + " Encontrado");
}
}
}
For the subnet (192.168.0.1-254)
checkHosts("192.168.0");
Once you have obtained a Host, you can check its properties
// InetAddress address = InetAddress.byName ...
System.out.println("Host Address: "+ address.getHostAddress());
System.out.println("Host Name: "+ address.getHostName());
System.out.println("CanonicalHostName: "+ address.getCanonicalHostName());
System.out.println("Address: "+ address.getAddress());
System.out.println("LocalHost: "+ address.getLocalHost());
System.out.println("LoopbackAddress: "+ address.getLoopbackAddress());