mirror of
https://github.com/LucasVbr/mini-chat.git
synced 2026-05-13 17:21:54 +00:00
24 lines
469 B
Java
24 lines
469 B
Java
package utils;
|
|
|
|
import java.net.InetAddress;
|
|
import java.net.UnknownHostException;
|
|
|
|
public class ResolutionDeNom {
|
|
|
|
/**
|
|
* TODO
|
|
*
|
|
* @param host
|
|
* @return
|
|
*/
|
|
public static String getIPAddress(String host) {
|
|
String address = null;
|
|
try {
|
|
address = InetAddress.getByName(host).getHostAddress();
|
|
} catch (UnknownHostException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return address;
|
|
}
|
|
}
|