Class ConnectOptions
java.lang.Object
io.vertx.core.net.ConnectOptions
Options for configuring how to connect to a TCP server.
- Author:
- Julien Viet
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructorConnectOptions(ConnectOptions other) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Get the host name to be used by the client connection.getPort()Get the port to be used by the client connection.Get proxy options for connectionsGet the remote address to connect to, if none is providedhost/portwille be used.intbooleanisSsl()Set the host name to be used by the client connection.Set the port to be used by the client connection.setProxyOptions(ProxyOptions proxyOptions) Set proxy options for connections via CONNECT proxy (e.g.setRemoteAddress(SocketAddress remoteAddress) Set the remote address to be used by the client connection.setSniServerName(String sniServerName) Set the SNI server name to use.setSsl(boolean ssl) Set whether SSL/TLS is enabled.setSslOptions(ClientSSLOptions sslOptions) Set the SSL options to use.setTimeout(int timeout) Override the client connect timeout in millis whentimeout >= 0or use the client defined connect timeoutClientOptionsBase.getConnectTimeout()whentimeout == -1.
-
Field Details
-
DEFAULT_SSL
public static final boolean DEFAULT_SSLSSL enable by default = false- See Also:
-
-
Constructor Details
-
ConnectOptions
public ConnectOptions()The default constructor -
ConnectOptions
Copy constructor- Parameters:
other- the options to copy
-
-
Method Details
-
getHost
Get the host name to be used by the client connection.- Returns:
- the host name
-
setHost
Set the host name to be used by the client connection.- Returns:
- a reference to this, so the API can be used fluently
-
getPort
-
setPort
Set the port to be used by the client connection.- Returns:
- a reference to this, so the API can be used fluently
-
getRemoteAddress
Get the remote address to connect to, if none is providedhost/portwille be used.- Returns:
- the remote address
-
setRemoteAddress
Set the remote address to be used by the client connection.When the server address is
null, the address will be resolved after thehostproperty by the Vert.x resolver and theportwill be used.Use this when you want to connect to a specific server address without name resolution or use a domain socket.
- Returns:
- a reference to this, so the API can be used fluently
-
getSniServerName
- Returns:
- the SNI (server name indication) server name
-
setSniServerName
Set the SNI server name to use.- Parameters:
sniServerName- the server name- Returns:
- a reference to this, so the API can be used fluently
-
getProxyOptions
-
setProxyOptions
Set proxy options for connections via CONNECT proxy (e.g. Squid) or a SOCKS proxy.When none is provided, the
NetClientOptionsproxy options will be used instead.- Parameters:
proxyOptions- proxy options object- Returns:
- a reference to this, so the API can be used fluently
-
isSsl
public boolean isSsl()- Returns:
- is SSL/TLS enabled?
-
setSsl
Set whether SSL/TLS is enabled.- Parameters:
ssl-trueif enabled- Returns:
- a reference to this, so the API can be used fluently
-
getSslOptions
- Returns:
- the SSL options
-
setSslOptions
Set the SSL options to use.When none is provided, the
NetClientOptionsSSL options will be used instead.- Parameters:
sslOptions- the SSL options to use- Returns:
- a reference to this, so the API can be used fluently
-
getTimeout
public int getTimeout()- Returns:
- the value of connect timeout in millis or
-1when using the client defined connect timeoutClientOptionsBase.getConnectTimeout()
-
setTimeout
Override the client connect timeout in millis whentimeout >= 0or use the client defined connect timeoutClientOptionsBase.getConnectTimeout()whentimeout == -1.- Parameters:
timeout- connect timeout, in ms- Returns:
- a reference to this, so the API can be used fluently
-