Package io.vertx.mongo.connection
Class SocketSettings
- java.lang.Object
-
- io.vertx.mongo.connection.SocketSettings
-
public class SocketSettings extends java.lang.ObjectAn immutable class representing socket settings used for connections to a MongoDB server.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description SocketSettings()SocketSettings(JsonObject json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetConnectTimeout()Gets the timeout for socket connect.java.lang.IntegergetReadTimeout()Gets the timeout for socket reads.java.lang.IntegergetReceiveBufferSize()Gets the receive buffer size.java.lang.IntegergetSendBufferSize()Gets the send buffer size.SocketSettingssetConnectTimeout(java.lang.Integer connectTimeout)Sets the socket connect timeout.SocketSettingssetReadTimeout(java.lang.Integer readTimeout)Sets the socket read timeout.SocketSettingssetReceiveBufferSize(java.lang.Integer receiveBufferSize)Sets the receive buffer size.SocketSettingssetSendBufferSize(java.lang.Integer sendBufferSize)Sets the send buffer size.JsonObjecttoJson()
-
-
-
Constructor Detail
-
SocketSettings
public SocketSettings()
-
SocketSettings
public SocketSettings(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
setConnectTimeout
public SocketSettings setConnectTimeout(java.lang.Integer connectTimeout)
Sets the socket connect timeout.- Parameters:
connectTimeout- the connect timeout (in milliseconds)- Returns:
- this
-
getConnectTimeout
public java.lang.Integer getConnectTimeout()
Gets the timeout for socket connect. Defaults to 10 seconds.- Returns:
- the connect timeout in the requested time unit.
-
setReadTimeout
public SocketSettings setReadTimeout(java.lang.Integer readTimeout)
Sets the socket read timeout.- Parameters:
readTimeout- the read timeout (in milliseconds)- Returns:
- this
-
getReadTimeout
public java.lang.Integer getReadTimeout()
Gets the timeout for socket reads. Defaults to 0, which indicates no timeout- Returns:
- the read timeout in the requested time unit, or 0 if there is no timeout
-
setReceiveBufferSize
public SocketSettings setReceiveBufferSize(java.lang.Integer receiveBufferSize)
Sets the receive buffer size.- Parameters:
receiveBufferSize- the receive buffer size- Returns:
- this
-
getReceiveBufferSize
public java.lang.Integer getReceiveBufferSize()
Gets the receive buffer size. Defaults to the operating system default.- Returns:
- the receive buffer size
-
setSendBufferSize
public SocketSettings setSendBufferSize(java.lang.Integer sendBufferSize)
Sets the send buffer size.- Parameters:
sendBufferSize- the send buffer size- Returns:
- this
-
getSendBufferSize
public java.lang.Integer getSendBufferSize()
Gets the send buffer size. Defaults to the operating system default.- Returns:
- the send buffer size
-
-