/** * Creates a Thrift TTransport to the given address with the given timeout. All created resources * are closed if an exception is thrown. * * @param addr * The address to connect the client to * @param timeoutMillis * The timeout in milliseconds for the connection * @return A TTransport connected to the given <code>addr</code> * @throws IOException * If the transport fails to be created/connected */ public static TTransport create(SocketAddress addr, long timeoutMillis) throws IOException { return INSTANCE.createInternal(addr, timeoutMillis); }
/** * Creates a Thrift TTransport to the given address with the given timeout. All created resources * are closed if an exception is thrown. * * @param addr * The address to connect the client to * @param timeoutMillis * The timeout in milliseconds for the connection * @return A TTransport connected to the given <code>addr</code> * @throws IOException * If the transport fails to be created/connected */ public static TTransport create(HostAndPort addr, long timeoutMillis) throws IOException { return INSTANCE.createInternal(new InetSocketAddress(addr.getHost(), addr.getPort()), timeoutMillis); }