Package org.apache.http.config
Class SocketConfig
- java.lang.Object
-
- org.apache.http.config.SocketConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SocketConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private int
backlogSize
static SocketConfig
DEFAULT
private int
rcvBufSize
private int
sndBufSize
private boolean
soKeepAlive
private int
soLinger
private boolean
soReuseAddress
private int
soTimeout
private boolean
tcpNoDelay
-
Constructor Summary
Constructors Constructor Description SocketConfig(int soTimeout, boolean soReuseAddress, int soLinger, boolean soKeepAlive, boolean tcpNoDelay, int sndBufSize, int rcvBufSize, int backlogSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SocketConfig
clone()
static SocketConfig.Builder
copy(SocketConfig config)
static SocketConfig.Builder
custom()
int
getBacklogSize()
Determines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.int
getRcvBufSize()
Determines the default value of theSocketOptions.SO_RCVBUF
parameter for newly created sockets.int
getSndBufSize()
Determines the default value of theSocketOptions.SO_SNDBUF
parameter for newly created sockets.int
getSoLinger()
Determines the default value of theSocketOptions.SO_LINGER
parameter for newly created sockets.int
getSoTimeout()
Determines the default socket timeout value for non-blocking I/O operations.boolean
isSoKeepAlive()
Determines the default value of theSocketOptions.SO_KEEPALIVE
parameter for newly created sockets.boolean
isSoReuseAddress()
Determines the default value of theSocketOptions.SO_REUSEADDR
parameter for newly created sockets.boolean
isTcpNoDelay()
Determines the default value of theSocketOptions.TCP_NODELAY
parameter for newly created sockets.java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT
public static final SocketConfig 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
-
-
Method Detail
-
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:
SocketOptions.SO_TIMEOUT
-
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:
SocketOptions.SO_REUSEADDR
-
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:
SocketOptions.SO_LINGER
-
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:
SocketOptions.SO_KEEPALIVE
-
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:
SocketOptions.TCP_NODELAY
-
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:
SocketOptions.SO_SNDBUF
-
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:
SocketOptions.SO_RCVBUF
-
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
protected SocketConfig clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
custom
public static SocketConfig.Builder custom()
-
copy
public static SocketConfig.Builder copy(SocketConfig config)
-
-