Package org.apache.http.config
Class SocketConfig
- java.lang.Object
-
- org.apache.http.config.SocketConfig
-
- All Implemented Interfaces:
java.lang.Cloneable
@Immutable public class SocketConfig extends java.lang.Object implements java.lang.Cloneable
Socket configuration.- Since:
- 4.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSocketConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description static SocketConfigDEFAULT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SocketConfigclone()static SocketConfig.Buildercopy(SocketConfig config)static SocketConfig.Buildercustom()intgetSoLinger()Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.intgetSoTimeout()Determines the default socket timeout value for non-blocking I/O operations.booleanisSoKeepAlive()Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.booleanisSoReuseAddress()Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.booleanisTcpNoDelay()Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT
public static final SocketConfig DEFAULT
-
-
Method Detail
-
getSoTimeout
public int getSoTimeout()
Determines the default socket timeout value for non-blocking I/O operations. Default:0(no timeout)- See Also:
SocketOptions.SO_TIMEOUT
-
isSoReuseAddress
public boolean isSoReuseAddress()
Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets. Default:false- See Also:
SocketOptions.SO_REUSEADDR
-
getSoLinger
public int getSoLinger()
Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets. Default:-1- See Also:
SocketOptions.SO_LINGER
-
isSoKeepAlive
public boolean isSoKeepAlive()
Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets. Default:-1- See Also:
SocketOptions.SO_KEEPALIVE
-
isTcpNoDelay
public boolean isTcpNoDelay()
Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets. Default:false- See Also:
SocketOptions.TCP_NODELAY
-
clone
protected SocketConfig clone() throws java.lang.CloneNotSupportedException
- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
custom
public static SocketConfig.Builder custom()
-
copy
public static SocketConfig.Builder copy(SocketConfig config)
-
-