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
public class DefaultSocketChannelConfig extends DefaultChannelConfig implements SocketChannelConfig
The defaultSocketChannelConfigimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.Socketsocket
-
Constructor Summary
Constructors Constructor Description DefaultSocketChannelConfig(java.net.Socket socket)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetReceiveBufferSize()Gets theStandardSocketOptions.SO_RCVBUFoption.intgetSendBufferSize()Gets theStandardSocketOptions.SO_SNDBUFoption.intgetSoLinger()Gets theStandardSocketOptions.SO_LINGERoption.intgetTrafficClass()Gets theStandardSocketOptions.IP_TOSoption.booleanisKeepAlive()Gets theStandardSocketOptions.SO_KEEPALIVEoption.booleanisReuseAddress()Gets theStandardSocketOptions.SO_REUSEADDRoption.booleanisTcpNoDelay()Gets theStandardSocketOptions.TCP_NODELAYoption.voidsetKeepAlive(boolean keepAlive)Sets theStandardSocketOptions.SO_KEEPALIVEoption.booleansetOption(java.lang.String key, java.lang.Object value)Sets a configuration property with the specified name and value.voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth)Sets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int).voidsetReceiveBufferSize(int receiveBufferSize)Sets theStandardSocketOptions.SO_RCVBUFoption.voidsetReuseAddress(boolean reuseAddress)Sets theStandardSocketOptions.SO_REUSEADDRoption.voidsetSendBufferSize(int sendBufferSize)Sets theStandardSocketOptions.SO_SNDBUFoption.voidsetSoLinger(int soLinger)Sets theStandardSocketOptions.SO_LINGERoption.voidsetTcpNoDelay(boolean tcpNoDelay)Sets theStandardSocketOptions.TCP_NODELAYoption.voidsetTrafficClass(int trafficClass)Sets theStandardSocketOptions.IP_TOSoption.-
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
-
-
-
-
Method Detail
-
setOption
public boolean setOption(java.lang.String key, java.lang.Object value)Description copied from interface:ChannelConfigSets 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:
setOptionin interfaceChannelConfig- Overrides:
setOptionin classDefaultChannelConfig- Returns:
trueif and only if the property has been set
-
getReceiveBufferSize
public int getReceiveBufferSize()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
getReceiveBufferSizein interfaceSocketChannelConfig
-
getSendBufferSize
public int getSendBufferSize()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
getSendBufferSizein interfaceSocketChannelConfig
-
getSoLinger
public int getSoLinger()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_LINGERoption.- Specified by:
getSoLingerin interfaceSocketChannelConfig
-
getTrafficClass
public int getTrafficClass()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.IP_TOSoption.- Specified by:
getTrafficClassin interfaceSocketChannelConfig
-
isKeepAlive
public boolean isKeepAlive()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_KEEPALIVEoption.- Specified by:
isKeepAlivein interfaceSocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
isReuseAddressin interfaceSocketChannelConfig
-
isTcpNoDelay
public boolean isTcpNoDelay()
Description copied from interface:SocketChannelConfigGets theStandardSocketOptions.TCP_NODELAYoption.- Specified by:
isTcpNoDelayin interfaceSocketChannelConfig
-
setKeepAlive
public void setKeepAlive(boolean keepAlive)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_KEEPALIVEoption.- Specified by:
setKeepAlivein interfaceSocketChannelConfig
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)Description copied from interface:SocketChannelConfigSets the performance preferences as specified inSocket.setPerformancePreferences(int, int, int).- Specified by:
setPerformancePreferencesin interfaceSocketChannelConfig
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
setReceiveBufferSizein interfaceSocketChannelConfig
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
setReuseAddressin interfaceSocketChannelConfig
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
setSendBufferSizein interfaceSocketChannelConfig
-
setSoLinger
public void setSoLinger(int soLinger)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.SO_LINGERoption.- Specified by:
setSoLingerin interfaceSocketChannelConfig
-
setTcpNoDelay
public void setTcpNoDelay(boolean tcpNoDelay)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.TCP_NODELAYoption.- Specified by:
setTcpNoDelayin interfaceSocketChannelConfig
-
setTrafficClass
public void setTrafficClass(int trafficClass)
Description copied from interface:SocketChannelConfigSets theStandardSocketOptions.IP_TOSoption.- Specified by:
setTrafficClassin interfaceSocketChannelConfig
-
-