Package org.apache.http.config
Class SocketConfig
java.lang.Object
org.apache.http.config.SocketConfig
- All Implemented Interfaces:
Cloneable
Socket configuration.
- Since:
- 4.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intstatic final SocketConfigprivate final intprivate final intprivate final booleanprivate final intprivate final booleanprivate final intprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionSocketConfig(int soTimeout, boolean soReuseAddress, int soLinger, boolean soKeepAlive, boolean tcpNoDelay, int sndBufSize, int rcvBufSize, int backlogSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected SocketConfigclone()static SocketConfig.Buildercopy(SocketConfig config) static SocketConfig.Buildercustom()intDetermines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.intDetermines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.intDetermines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.intDetermines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.intDetermines the default socket timeout value for non-blocking I/O operations.booleanDetermines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.booleanDetermines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.booleanDetermines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.toString()
-
Field Details
-
DEFAULT
-
soTimeout
private final int soTimeout -
soReuseAddress
private final boolean soReuseAddress -
soLinger
private final int soLinger -
soKeepAlive
private final boolean soKeepAlive -
tcpNoDelay
private final boolean tcpNoDelay -
sndBufSize
private final int sndBufSize -
rcvBufSize
private final int rcvBufSize -
backlogSize
private final int backlogSize
-
-
Constructor Details
-
SocketConfig
SocketConfig(int soTimeout, boolean soReuseAddress, int soLinger, boolean soKeepAlive, boolean tcpNoDelay, int sndBufSize, int rcvBufSize, int backlogSize)
-
-
Method Details
-
getSoTimeout
public int getSoTimeout()Determines the default socket timeout value for non-blocking I/O operations.Default:
0(no timeout)- Returns:
- the default socket timeout value for non-blocking I/O operations.
- See Also:
-
isSoReuseAddress
public boolean isSoReuseAddress()Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.Default:
false- Returns:
- the default value of the
SocketOptions.SO_REUSEADDRparameter. - See Also:
-
getSoLinger
public int getSoLinger()Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.Default:
-1- Returns:
- the default value of the
SocketOptions.SO_LINGERparameter. - See Also:
-
isSoKeepAlive
public boolean isSoKeepAlive()Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.Default:
false- Returns:
- the default value of the
SocketOptions.SO_KEEPALIVEparameter. - See Also:
-
isTcpNoDelay
public boolean isTcpNoDelay()Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.Default:
true- Returns:
- the default value of the
SocketOptions.TCP_NODELAYparameter. - See Also:
-
getSndBufSize
public int getSndBufSize()Determines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.Default:
0(system default)- Returns:
- the default value of the
SocketOptions.SO_SNDBUFparameter. - Since:
- 4.4
- See Also:
-
getRcvBufSize
public int getRcvBufSize()Determines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.Default:
0(system default)- Returns:
- the default value of the
SocketOptions.SO_RCVBUFparameter. - Since:
- 4.4
- See Also:
-
getBacklogSize
public int getBacklogSize()Determines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.Default:
0(system default)- Returns:
- the maximum queue length for incoming connection indications
- Since:
- 4.4
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
toString
-
custom
-
copy
-