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
public class DefaultSocketChannelConfig extends DefaultChannelConfig implements SocketChannelConfig
The defaultSocketChannelConfig
implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultSocketChannelConfig(Socket socket)
Creates a new instance.
-
Method Summary
-
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
-
-
-
-
Constructor Detail
-
DefaultSocketChannelConfig
public DefaultSocketChannelConfig(Socket socket)
Creates a new instance.
-
-
Method Detail
-
setOption
public boolean setOption(String key, Object value)
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
-
-