Package com.mongodb.connection
Class SocketSettings
java.lang.Object
com.mongodb.connection.SocketSettings
An immutable class representing socket settings used for connections to a MongoDB server.
- Since:
- 3.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA builder for an instance ofSocketSettings.
- 
Method SummaryModifier and TypeMethodDescriptionstatic SocketSettings.Builderbuilder()Gets a builder for an instance ofSocketSettings.static SocketSettings.Builderbuilder(SocketSettings socketSettings) Creates a builder instance.booleanintgetConnectTimeout(TimeUnit timeUnit) Gets the timeout for socket connect.Gets the proxy settings used for connecting to MongoDB via a SOCKS5 proxy server.intgetReadTimeout(TimeUnit timeUnit) Gets the timeout for socket reads.intGets the receive buffer size.intGets the send buffer size.inthashCode()toString()
- 
Method Details- 
builderGets a builder for an instance ofSocketSettings.- Returns:
- the builder
 
- 
builderCreates a builder instance.- Parameters:
- socketSettings- existing SocketSettings to default the builder settings on.
- Returns:
- a builder
- Since:
- 3.7
 
- 
getConnectTimeoutGets the timeout for socket connect. Defaults to 10 seconds.- Parameters:
- timeUnit- the time unit to get the timeout in
- Returns:
- the connect timeout in the requested time unit.
 
- 
getReadTimeoutGets the timeout for socket reads. Defaults to 0, which indicates no timeout- Parameters:
- timeUnit- the time unit to get the timeout in
- Returns:
- the read timeout in the requested time unit, or 0 if there is no timeout
- See Also:
 
- 
getProxySettingsGets the proxy settings used for connecting to MongoDB via a SOCKS5 proxy server.- Returns:
- The ProxySettingsinstance containing the SOCKS5 proxy configuration.
- Since:
- 4.11
- See Also:
 
- 
getReceiveBufferSizepublic int getReceiveBufferSize()Gets the receive buffer size. Defaults to the operating system default.- Returns:
- the receive buffer size
 
- 
getSendBufferSizepublic int getSendBufferSize()Gets the send buffer size. Defaults to the operating system default.- Returns:
- the send buffer size
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-