Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/01/2009, 18:34
megajandro
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Ubicación: por ahi!!!
Mensajes: 113
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Equivalente a un ping

fijate si te sirve algo asi.


public class TestInetAddress extends TestCase{

public void test(){
try {

// Get hostname by textual representation of IP address
InetAddress addr = InetAddress.getByName("java.sun.com");
// Get the host name
String hostname = addr.getHostName();
System.out.println(hostname);
// Get canonical host name
String canonicalhostname = addr.getCanonicalHostName();
System.out.println(canonicalhostname);
} catch (UnknownHostException e) {
}

}