FileDocCategorySizeDatePackage
Probe.javaAPI DocExample749Sat Nov 25 12:55:56 GMT 2000None

Probe

public class Probe extends Object
Probe a network address for useful information.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		if (argv.length == 0) {
			System.err.println("lusage: Probe hostname [...]");
			return;
		}
		Probe p = new Probe();
		for (int i=0; i<argv.length; i++)
			p.probe(argv[i]);
	
voidprobe(java.lang.String hn)
Do all the probing for one hostname

		System.out.println("Java NetProbe 0.0: probing " + hn);
		try {
			InetAddress all[] = InetAddress.getAllByName(hn);
			System.out.println(hn + " has " + all.length + " addresses.");
			for (int i=0; i<all.length; i++)
				System.out.println("Address " + all[i]);
		} catch (UnknownHostException ue) {
			System.out.println("Unknown host " + hn);
		}