Creates a new TCP client instance with the passed address of the target server.

@param host Hostname for the target server.
@param port Port for the target server.

@return A new {@code TcpClient} instance.
18022
public static TcpClient<ByteBuf, ByteBuf> newClient(String host, int port) {
        return newClient(new InetSocketAddress(host, port));
    }
642753
@Override
  public Transport newInstance(final String hostAddress,
                               final int port,
                               final EStage<TransportEvent> clientStage,
                               final EStage<TransportEvent> serverStage,
                               final int numberOfTries,
                               final int retryTimeout) {
    try {
      TcpPortProvider tcpPortProvider = Tang.Factory.getTang().newInjector().getInstance(TcpPortProvider.class);
      return newInstance(hostAddress, port, clientStage,
              serverStage, numberOfTries, retryTimeout, tcpPortProvider);
    } catch (final InjectionException e) {
      throw new RuntimeException(e);
    }
  }
754248
public static InetSocketAddress createAddress(String host, int port) {
		if (StrUtil.isBlank(host)) {
			return new InetSocketAddress(port);
		}
		return new InetSocketAddress(host, port);
	}
1062205
public static WebsocketClientTransport create(TcpClient client) {
    Objects.requireNonNull(client, "client must not be null");

    return create(HttpClient.from(client), DEFAULT_PATH);
  }
730670
function Client(host, port) {
    // Invokes with new if called without
    if (false === (this instanceof Client)) {
  	return new Client(host, port)
    }

    this.host = host;
    this.port = port;
}
607622
public static TcpClientTransport create(String bindAddress, int port) {
    Objects.requireNonNull(bindAddress, "bindAddress must not be null");

    TcpClient tcpClient = TcpClient.create().host(bindAddress).port(port);
    return create(tcpClient);
  }
1322553
public final UdpClient host(String host) {
		Objects.requireNonNull(host, "host");
		return bootstrap(b -> b.remoteAddress(host, getPort(b)));
	}
1309549
public static WebsocketClientTransport create(int port) {
    TcpClient client = TcpClient.create().port(port);
    return create(client);
  }
1039982
public static Socket createSocket(UrlParser urlParser, String host) throws IOException {
    return socketHandler.apply(urlParser, host);
  }
652758
public Elasticsearch host(String hostname, int port, String protocol) {
		final Host host =
			new Host(
				Preconditions.checkNotNull(hostname),
				port,
				Preconditions.checkNotNull(protocol));
		hosts.add(host);
		return this;
	}
598537
private MBeanServerConnection createServerConnection(String host, int port) throws IOException {
            jmxServiceURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi");
            JMXConnector jmxc = JMXConnectorFactory.connect(jmxServiceURL, null);
            return jmxc.getMBeanServerConnection();            
    }
16263
public static HostAndPort fromString(String hostPort, int defaultPort) {
    if (hostPort == null) throw new NullPointerException("hostPort == null");

    String host = hostPort;
    int endHostIndex = hostPort.length();
    if (hostPort.startsWith("[")) { // Bracketed IPv6
      endHostIndex = hostPort.lastIndexOf(']') + 1;
      host = hostPort.substring(1, endHostIndex == 0 ? 1 : endHostIndex - 1);
      if (!Endpoint.newBuilder().parseIp(host)) { // reuse our IPv6 validator
        throw new IllegalArgumentException(hostPort + " contains an invalid IPv6 literal");
      }
    } else {
      int colonIndex = hostPort.indexOf(':'), nextColonIndex = hostPort.lastIndexOf(':');
      if (colonIndex >= 0) {
        if (colonIndex == nextColonIndex) { // only 1 colon
          host = hostPort.substring(0, colonIndex);
          endHostIndex = colonIndex;
        } else if (!Endpoint.newBuilder().parseIp(hostPort)) { // reuse our IPv6 validator
          throw new IllegalArgumentException(hostPort + " is an invalid IPv6 literal");
        }
      }
    }
    if (host.isEmpty()) throw new IllegalArgumentException(hostPort + " has an empty host");
    if (endHostIndex + 1 < hostPort.length() && hostPort.charAt(endHostIndex) == ':') {
      return new HostAndPort(host, validatePort(hostPort.substring(endHostIndex + 1), hostPort));
    }
    return new HostAndPort(host, defaultPort);
  }
771620
public static NetworkPort remotePort(String hostname, int port){
        return new RemoteNetworkPort(hostname, port, NetworkPort.Type.TCP);
    }
276375
public CliCommandBuilder setConnection(final String hostname, final int port) {
        addCliArgument(CliArgument.CONNECT);
        setController(hostname, port);
        return this;
    }
653068
public static InetSocketAddress createSocketAddr(String target, int defaultPort) {
		int colonIndex = target.indexOf(':');
		if (colonIndex < 0 && defaultPort == -1) {
			throw new RuntimeException("Not a host:port pair: " + target);
		}
		String hostname = "";
		int port = -1;
		if (!target.contains("/")) {
			if (colonIndex == -1) {
				hostname = target;
			} else {
				// must be the old style <host>:<port>
				hostname = target.substring(0, colonIndex);
				port = Integer.parseInt(target.substring(colonIndex + 1));
			}
		} else {
			// a new uri
			try {
				URI addr = new URI(target);
				hostname = addr.getHost();
				port = addr.getPort();
			} catch (URISyntaxException use) {
				LOG.fatal(use);
			}
		}

		if (port == -1) {
			port = defaultPort;
		}

		if (getStaticResolution(hostname) != null) {
			hostname = getStaticResolution(hostname);
		}
		return new InetSocketAddress(hostname, port);
	}
231237
public static ThriftClient build(String host, int port) throws TException {
        return build(host, port, null);
    }
238940
public TransportServer createServer(
      String host, int port, List<TransportServerBootstrap> bootstraps) {
    return new TransportServer(this, host, port, rpcHandler, bootstraps);
  }