public static final class SocketSettings.Builder
extends java.lang.Object
SocketSettings
.Modifier and Type | Method and Description |
---|---|
SocketSettings.Builder |
applyConnectionString(ConnectionString connectionString)
Takes the settings from the given
ConnectionString and applies them to the builder |
SocketSettings.Builder |
applySettings(SocketSettings socketSettings)
Applies the socketSettings to the builder
|
SocketSettings |
build()
Build an instance of
SocketSettings . |
SocketSettings.Builder |
connectTimeout(int connectTimeout,
java.util.concurrent.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,
java.util.concurrent.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 applySettings(SocketSettings socketSettings)
Note: Overwrites all existing settings
socketSettings
- the socketSettingspublic SocketSettings.Builder connectTimeout(int connectTimeout, java.util.concurrent.TimeUnit timeUnit)
connectTimeout
- the connect timeouttimeUnit
- the time unitpublic SocketSettings.Builder readTimeout(int readTimeout, java.util.concurrent.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
and applies them to the builderconnectionString
- the connection string containing details of how to connect to MongoDBConnectionString.getConnectTimeout()
,
ConnectionString.getSocketTimeout()
public SocketSettings build()
SocketSettings
.Copyright © 2010 - 2020 Adobe. All Rights Reserved