public class ConfigOptions extends Object
构造器和说明 |
---|
ConfigOptions() |
限定符和类型 | 方法和说明 |
---|---|
int |
getConnectTimeout()
The connection timeout in milliseconds.
|
long |
getMaxAutoConnectRetryTime()
Get the max auto connect retry time in milliseconds.
|
boolean |
getSocketKeepAlive()
Get whether the socket keeps alive or not
|
int |
getSocketTimeout()
Get the socket timeout in milliseconds.
|
boolean |
getUseNagle()
Get whether use the Nagle Algorithm or not
|
boolean |
getUseSSL()
Get whether use the SSL or not
|
void |
setConnectTimeout(int connectTimeoutMillis)
Set the connection timeout in milliseconds.
|
void |
setMaxAutoConnectRetryTime(long maxRetryTimeMillis)
Set the max auto connect retry time in milliseconds.
|
void |
setSocketKeepAlive(boolean on)
This flag controls the socket keep alive feature that keeps a connection alive through firewalls
Socket.setKeepAlive(boolean) |
void |
setSocketTimeout(int socketTimeoutMillis)
Get the socket timeout in milliseconds.
|
void |
setUseNagle(boolean on)
Set whether enable/disable Nagle's algorithm(disable/enable TCP_NODELAY)
|
void |
setUseSSL(boolean on)
Set whether use the SSL or not
|
public int getConnectTimeout()
Socket.connect(java.net.SocketAddress, int)
Default is 10,000ms.public long getMaxAutoConnectRetryTime()
public boolean getSocketKeepAlive()
public int getSocketTimeout()
Socket.setSoTimeout(int)
Default is 0ms and means no timeout.public boolean getUseNagle()
public boolean getUseSSL()
public void setConnectTimeout(int connectTimeoutMillis)
Socket.connect(java.net.SocketAddress, int)
connectTimeoutMillis
- The connection timeout in milliseconds. Default is 10,000ms.public void setMaxAutoConnectRetryTime(long maxRetryTimeMillis)
maxRetryTimeMillis
- the max auto connect retry time in millisecondspublic void setSocketKeepAlive(boolean on)
Socket.setKeepAlive(boolean)
on
- whether keep-alive is enabled on each socket. Default is false.public void setSocketTimeout(int socketTimeoutMillis)
Socket.setSoTimeout(int)
socketTimeoutMillis
- The socket timeout in milliseconds. Default is 0ms and means no timeout.public void setUseNagle(boolean on)
on
- false
to enable TCP_NODELAY, default to be false and going to use enable TCP_NODELAY.public void setUseSSL(boolean on)
on
- Default to be false.Copyright © 2018. All rights reserved.