Class TcpClientConfig
java.lang.Object
io.vertx.core.net.EndpointConfig
io.vertx.core.net.TcpEndpointConfig
io.vertx.core.net.TcpClientConfig
Configuration of a
NetClient- Author:
- Julien Viet
-
Constructor Summary
ConstructorsConstructorDescriptionTcpClientConfig(ClientOptionsBase options) TcpClientConfig(NetClientOptions options) TcpClientConfig(TcpClientConfig other) -
Method Summary
Modifier and TypeMethodDescriptionaddNonProxyHost(String host) Add ahostto thegetNonProxyHosts()list.Get proxy options for connectionsintsetConnectTimeout(Duration connectTimeout) Set the connect timeoutsetIdleTimeout(Duration idleTimeout) Set the stream idle timeout, zero ornullmeans don't time out.setLocalAddress(SocketAddress localAddress) Set the local address to bind for network connections.setLogConfig(LogConfig config) Configure the log config: Netty's stream pipeline is configured for logging on Netty's logger.setMetricsName(String metricsName) Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.setNonProxyHosts(List<String> nonProxyHosts) Set a list of remote hosts that are not proxied when the client is configured to use a proxy.setProxyOptions(ProxyOptions proxyOptions) Set proxy options for connections via CONNECT proxy (e.g.setReadIdleTimeout(Duration idleTimeout) Set the stream read idle timeout, zero ornullmeans or null means don't time out.setReconnectAttempts(int attempts) Set the value of reconnect attemptssetReconnectInterval(Duration interval) Set the reconnect intervalsetSsl(boolean ssl) Set whether SSL/TLS is enabledsetTransportConfig(TcpConfig transportConfig) Set the client TCP transport config.setWriteIdleTimeout(Duration idleTimeout) Set the stream write idle timeout, zero ornullmeans don't time out.Methods inherited from class TcpEndpointConfig
getTransportConfig, isSslMethods inherited from class EndpointConfig
getIdleTimeout, getLogConfig, getMetricsName, getReadIdleTimeout, getWriteIdleTimeout
-
Constructor Details
-
TcpClientConfig
public TcpClientConfig() -
TcpClientConfig
-
TcpClientConfig
-
TcpClientConfig
-
-
Method Details
-
setTransportConfig
Description copied from class:TcpEndpointConfigSet the client TCP transport config.- Overrides:
setTransportConfigin classTcpEndpointConfig- Parameters:
transportConfig- the transport config- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeout
Description copied from class:EndpointConfigSet the stream idle timeout, zero ornullmeans don't time out. This determines if a stream will timeout and be closed if no data is received nor sent within the timeout.- Overrides:
setIdleTimeoutin classTcpEndpointConfig- Parameters:
idleTimeout- the idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setReadIdleTimeout
Description copied from class:EndpointConfigSet the stream read idle timeout, zero or
nullmeans or null means don't time out. This determines if a stream will timeout and be closed if no data is received within the timeout.- Overrides:
setReadIdleTimeoutin classTcpEndpointConfig- Parameters:
idleTimeout- the read idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setWriteIdleTimeout
Description copied from class:EndpointConfigSet the stream write idle timeout, zero or
nullmeans don't time out. This determines if a stream will timeout and be closed if no data is sent within the timeout.- Overrides:
setWriteIdleTimeoutin classTcpEndpointConfig- Parameters:
idleTimeout- the write idle timeout- Returns:
- a reference to this, so the API can be used fluently
-
setMetricsName
Description copied from class:EndpointConfigSet the metrics name identifying the reported metrics, useful for grouping metrics with the same name.- Overrides:
setMetricsNamein classTcpEndpointConfig- Parameters:
metricsName- the metrics name- Returns:
- a reference to this, so the API can be used fluently
-
setLogConfig
Description copied from class:EndpointConfigConfigure the log config: Netty's stream pipeline is configured for logging on Netty's logger.- Overrides:
setLogConfigin classTcpEndpointConfig- Parameters:
config- the log config- Returns:
- a reference to this, so the API can be used fluently
-
setSsl
Description copied from class:TcpEndpointConfigSet whether SSL/TLS is enabled- Overrides:
setSslin classTcpEndpointConfig- Parameters:
ssl- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
getConnectTimeout
- Returns:
- the value of connect timeout
-
setConnectTimeout
Set the connect timeout- Parameters:
connectTimeout- connect timeout, in ms- 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.- Parameters:
proxyOptions- proxy options object- Returns:
- a reference to this, so the API can be used fluently
-
getNonProxyHosts
-
setNonProxyHosts
Set a list of remote hosts that are not proxied when the client is configured to use a proxy. This list serves the same purpose than the JVMnonProxyHostsconfiguration.Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
- Parameters:
nonProxyHosts- the list of non proxies hosts- Returns:
- a reference to this, so the API can be used fluently
-
addNonProxyHost
Add ahostto thegetNonProxyHosts()list.- Parameters:
host- the added host- Returns:
- a reference to this, so the API can be used fluently
-
getLocalAddress
- Returns:
- the local address to bind for network connections.
-
setLocalAddress
Set the local address to bind for network connections. When the local address is null, it will pick any local address and a random port, the default local address is null.- Parameters:
localAddress- the local address- Returns:
- a reference to this, so the API can be used fluently
-
getReconnectAttempts
public int getReconnectAttempts()- Returns:
- the value of reconnect attempts
-
setReconnectAttempts
Set the value of reconnect attempts- Parameters:
attempts- the maximum number of reconnect attempts- Returns:
- a reference to this, so the API can be used fluently
-
getReconnectInterval
- Returns:
- the value of reconnect interval
-
setReconnectInterval
Set the reconnect interval- Parameters:
interval- the reconnect interval- Returns:
- a reference to this, so the API can be used fluently
-