INNER CODE UNIT · Java
create
scalecube/scalecube-services · services-api/src/main/java/io/scalecube/services/Address.java:62
public static Address create(String host, int port) {
return new Address(host, port);
}
/**
* Getting local IP address by the address of local host. <b>NOTE:</b> returned IP address is
* expected to be a publicly visible IP address.
*
* @throws RuntimeException wrapped {@link UnknownHostException}
*/
public static InetAddress getLocalIpAddress() {
try {
return InetAddress.getLocalHost();
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}