public class NetUtils extends Object
Constructor and Description |
---|
NetUtils() |
Modifier and Type | Method and Description |
---|---|
static InetSocketAddress |
createSocketAddr(String addr) |
static InetSocketAddress |
createSocketAddr(String host,
int port)
Util method to build socket addr from either:
|
static InetSocketAddress |
createUnresolved(String addr) |
static InetSocketAddress |
getConnectAddress(InetSocketAddress addr)
Returns InetSocketAddress that a client can use to
connect to the server.
|
static boolean |
isLocalAddress(InetAddress addr)
Given an InetAddress, checks to see if the address is a local address, by
comparing the address with all the interfaces on the node.
|
static String |
normalizeHost(String host) |
static String |
normalizeInetSocketAddress(InetSocketAddress addr) |
public static String normalizeInetSocketAddress(InetSocketAddress addr)
public static InetSocketAddress createSocketAddr(String addr)
public static InetSocketAddress createSocketAddr(String host, int port)
public static InetSocketAddress createUnresolved(String addr)
public static InetSocketAddress getConnectAddress(InetSocketAddress addr)
addr
- of a listenerpublic static boolean isLocalAddress(InetAddress addr)
addr
- address to check if it is local node's addressCopyright © 2014 Apache Software Foundation. All Rights Reserved.