Package org.jboss.netty.channel.socket
Class DefaultSocketChannelConfig
java.lang.Object
org.jboss.netty.channel.DefaultChannelConfig
org.jboss.netty.channel.socket.DefaultSocketChannelConfig
- All Implemented Interfaces:
ChannelConfig
,SocketChannelConfig
- Direct Known Subclasses:
DefaultNioSocketChannelConfig
The default
SocketChannelConfig
implementation.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets theStandardSocketOptions.SO_RCVBUF
option.int
Gets theStandardSocketOptions.SO_SNDBUF
option.int
Gets theStandardSocketOptions.SO_LINGER
option.int
Gets theStandardSocketOptions.IP_TOS
option.boolean
Gets theStandardSocketOptions.SO_KEEPALIVE
option.boolean
Gets theStandardSocketOptions.SO_REUSEADDR
option.boolean
Gets theStandardSocketOptions.TCP_NODELAY
option.void
setKeepAlive
(boolean keepAlive) Sets theStandardSocketOptions.SO_KEEPALIVE
option.boolean
Sets a configuration property with the specified name and value.void
setPerformancePreferences
(int connectionTime, int latency, int bandwidth) Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int)
.void
setReceiveBufferSize
(int receiveBufferSize) Sets theStandardSocketOptions.SO_RCVBUF
option.void
setReuseAddress
(boolean reuseAddress) Sets theStandardSocketOptions.SO_REUSEADDR
option.void
setSendBufferSize
(int sendBufferSize) Sets theStandardSocketOptions.SO_SNDBUF
option.void
setSoLinger
(int soLinger) Sets theStandardSocketOptions.SO_LINGER
option.void
setTcpNoDelay
(boolean tcpNoDelay) Sets theStandardSocketOptions.TCP_NODELAY
option.void
setTrafficClass
(int trafficClass) Sets theStandardSocketOptions.IP_TOS
option.Methods inherited from class org.jboss.netty.channel.DefaultChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.netty.channel.ChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
-
Field Details
-
socket
-
-
Constructor Details
-
DefaultSocketChannelConfig
Creates a new instance.
-
-
Method Details
-
setOption
Description copied from interface:ChannelConfig
Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:public boolean setOption(String name, Object value) { if (super.setOption(name, value)) { return true; } if (name.equals("additionalOption")) { .... return true; } return false; }
- Specified by:
setOption
in interfaceChannelConfig
- Overrides:
setOption
in classDefaultChannelConfig
- Returns:
true
if and only if the property has been set
-
getReceiveBufferSize
public int getReceiveBufferSize()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_RCVBUF
option.- Specified by:
getReceiveBufferSize
in interfaceSocketChannelConfig
-
getSendBufferSize
public int getSendBufferSize()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_SNDBUF
option.- Specified by:
getSendBufferSize
in interfaceSocketChannelConfig
-
getSoLinger
public int getSoLinger()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_LINGER
option.- Specified by:
getSoLinger
in interfaceSocketChannelConfig
-
getTrafficClass
public int getTrafficClass()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.IP_TOS
option.- Specified by:
getTrafficClass
in interfaceSocketChannelConfig
-
isKeepAlive
public boolean isKeepAlive()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_KEEPALIVE
option.- Specified by:
isKeepAlive
in interfaceSocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.SO_REUSEADDR
option.- Specified by:
isReuseAddress
in interfaceSocketChannelConfig
-
isTcpNoDelay
public boolean isTcpNoDelay()Description copied from interface:SocketChannelConfig
Gets theStandardSocketOptions.TCP_NODELAY
option.- Specified by:
isTcpNoDelay
in interfaceSocketChannelConfig
-
setKeepAlive
public void setKeepAlive(boolean keepAlive) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_KEEPALIVE
option.- Specified by:
setKeepAlive
in interfaceSocketChannelConfig
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Description copied from interface:SocketChannelConfig
Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int)
.- Specified by:
setPerformancePreferences
in interfaceSocketChannelConfig
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_RCVBUF
option.- Specified by:
setReceiveBufferSize
in interfaceSocketChannelConfig
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_REUSEADDR
option.- Specified by:
setReuseAddress
in interfaceSocketChannelConfig
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_SNDBUF
option.- Specified by:
setSendBufferSize
in interfaceSocketChannelConfig
-
setSoLinger
public void setSoLinger(int soLinger) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_LINGER
option.- Specified by:
setSoLinger
in interfaceSocketChannelConfig
-
setTcpNoDelay
public void setTcpNoDelay(boolean tcpNoDelay) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.TCP_NODELAY
option.- Specified by:
setTcpNoDelay
in interfaceSocketChannelConfig
-
setTrafficClass
public void setTrafficClass(int trafficClass) Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.IP_TOS
option.- Specified by:
setTrafficClass
in interfaceSocketChannelConfig
-