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)
Sets keep-alive.
|
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 unitpublic SocketSettings.Builder keepAlive(boolean keepAlive)
keepAlive
- true if keep-alive should be enabledpublic 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
.