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 int
static final SocketConfig
private final int
private final int
private final boolean
private final int
private final boolean
private final int
private 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 SocketConfig
clone()
static SocketConfig.Builder
copy
(SocketConfig config) static SocketConfig.Builder
custom()
int
Determines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.int
Determines the default value of theSocketOptions.SO_RCVBUF
parameter for newly created sockets.int
Determines the default value of theSocketOptions.SO_SNDBUF
parameter for newly created sockets.int
Determines the default value of theSocketOptions.SO_LINGER
parameter for newly created sockets.int
Determines the default socket timeout value for non-blocking I/O operations.boolean
Determines the default value of theSocketOptions.SO_KEEPALIVE
parameter for newly created sockets.boolean
Determines the default value of theSocketOptions.SO_REUSEADDR
parameter for newly created sockets.boolean
Determines the default value of theSocketOptions.TCP_NODELAY
parameter 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_REUSEADDR
parameter for newly created sockets.Default:
false
- Returns:
- the default value of the
SocketOptions.SO_REUSEADDR
parameter. - See Also:
-
getSoLinger
public int getSoLinger()Determines the default value of theSocketOptions.SO_LINGER
parameter for newly created sockets.Default:
-1
- Returns:
- the default value of the
SocketOptions.SO_LINGER
parameter. - See Also:
-
isSoKeepAlive
public boolean isSoKeepAlive()Determines the default value of theSocketOptions.SO_KEEPALIVE
parameter for newly created sockets.Default:
false
- Returns:
- the default value of the
SocketOptions.SO_KEEPALIVE
parameter. - See Also:
-
isTcpNoDelay
public boolean isTcpNoDelay()Determines the default value of theSocketOptions.TCP_NODELAY
parameter for newly created sockets.Default:
true
- Returns:
- the default value of the
SocketOptions.TCP_NODELAY
parameter. - See Also:
-
getSndBufSize
public int getSndBufSize()Determines the default value of theSocketOptions.SO_SNDBUF
parameter for newly created sockets.Default:
0
(system default)- Returns:
- the default value of the
SocketOptions.SO_SNDBUF
parameter. - Since:
- 4.4
- See Also:
-
getRcvBufSize
public int getRcvBufSize()Determines the default value of theSocketOptions.SO_RCVBUF
parameter for newly created sockets.Default:
0
(system default)- Returns:
- the default value of the
SocketOptions.SO_RCVBUF
parameter. - 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:
clone
in classObject
- Throws:
CloneNotSupportedException
-
toString
-
custom
-
copy
-