static InetAddress getLocalInetAddress(String byConnecting, int port) {
		InetAddress addr = getAddressWithSocket(byConnecting, port);
		if (addr == null) {
			addr = getAddressWithSocket("www.baidu.com", 80);
		}
		if (addr == null) {
			try {
				addr = getFirstNonLoopbackAddress(true, false);
			} catch (SocketException e2) {
				noOp();
			}
		}
		return addr;
	}
Get local host name by connecting to a server.

@param byConnecting the server address to connect.
@param port         the port to connect
@return localhost name. if fails, return "localhost"
ngrinder-core/src/main/java/net/grinder/util/NetworkUtils.java