Hi all, I have a problem :

I was writing a little program that display all ip (all host) connected to my router and so in my same subnetwork.

Now I'll show my idea:
 private boolean pingHost(InetAddress ip) throws IOException{
			 System.out.println(ip.toString() +"IS REACHABLE");
			 return true;
			 return false;

I have made this to generate all ip in my range:

private ArrayList<InetAddress> generateAllSubnetIP(InetAddress localHostIP){
		  ArrayList<InetAddress> allsubnetIP = new ArrayList<InetAddress>();
		  byte[] localIPbyte = localHostIP.getAddress();
		  for (int i = 0; i < 256; i++) {
				  byte[] tempIP={localIPbyte[0],localIPbyte[1],localIPbyte[2],(byte)i};
				try {
				} catch (UnknownHostException e) {
					System.out.println("UnknownHost generating all ip address");
		  return allsubnetIP;

and then I call pingHost for all the ip stored in the ArrayList.

but this doesn't work...

Any idea ?

I hope that you can understand my question...if not ask me for more details...

Thank you...