[Rssmailer-cvs] JDK15Playpen/src/be/tomk/scrap IPScanner.java,NONE,1.1
Status: Planning
Brought to you by:
tomklaasen
|
From: Tom K. <tom...@us...> - 2004-12-21 16:49:57
|
Update of /cvsroot/rssmailer/JDK15Playpen/src/be/tomk/scrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17367/src/be/tomk/scrap Added Files: IPScanner.java Log Message: scrap --- NEW FILE: IPScanner.java --- package be.tomk.scrap; import java.io.IOException; import java.net.InetAddress; public class IPScanner { public static void main(String[] args) throws IOException { for (int timeout = 1; timeout < 10; timeout++) { System.out.println("Timeout: "+timeout); for (int i = 1; i<255; i++) { InetAddress address = InetAddress.getByAddress(new byte[]{(byte)192, (byte)168, (byte)123, (byte)i}); System.out.println("Pinging "+address.getHostAddress()); if (address.isReachable(timeout*1000)) { System.out.println("Found "+address.getHostAddress()); } } } } } |