public static class SocketSettings.Builder extends Object
SocketSettings
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SocketSettings.Builder |
applyConnectionString(ConnectionString connectionString)
Apply any socket settings specified in the connection string to this builder.
|
SocketSettings |
build()
Build an instance of
SocketSettings . |
SocketSettings.Builder |
connectTimeout(int connectTimeout,
TimeUnit timeUnit)
Sets the socket connect timeout.
|
SocketSettings.Builder |
keepAlive(boolean keepAlive)
Deprecated.
configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.
|
SocketSettings.Builder |
readTimeout(int readTimeout,
TimeUnit timeUnit)
Sets the socket read timeout.
|
SocketSettings.Builder |
receiveBufferSize(int receiveBufferSize)
Sets the receive buffer size.
|
SocketSettings.Builder |
sendBufferSize(int sendBufferSize)
Sets the send buffer size.
|
public SocketSettings.Builder connectTimeout(int connectTimeout, TimeUnit timeUnit)
connectTimeout
- the connect timeouttimeUnit
- the time unitpublic SocketSettings.Builder readTimeout(int readTimeout, TimeUnit timeUnit)
readTimeout
- the read timeouttimeUnit
- the time unit@Deprecated public SocketSettings.Builder keepAlive(boolean keepAlive)
keepAlive
- false if keep-alive should be disabledpublic SocketSettings.Builder receiveBufferSize(int receiveBufferSize)
receiveBufferSize
- the receive buffer sizepublic SocketSettings.Builder sendBufferSize(int sendBufferSize)
sendBufferSize
- the send buffer sizepublic SocketSettings.Builder applyConnectionString(ConnectionString connectionString)
connectionString
- the connection stringConnectionString.getConnectTimeout()
,
ConnectionString.getSocketTimeout()
public SocketSettings build()
SocketSettings
.