Package org.jboss.netty.channel.socket
Class DefaultDatagramChannelConfig
java.lang.Object
org.jboss.netty.channel.DefaultChannelConfig
org.jboss.netty.channel.socket.DefaultDatagramChannelConfig
- All Implemented Interfaces:
ChannelConfig,DatagramChannelConfig
- Direct Known Subclasses:
DefaultNioDatagramChannelConfig
public class DefaultDatagramChannelConfig
extends DefaultChannelConfig
implements DatagramChannelConfig
The default
DatagramChannelConfig implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ReceiveBufferSizePredictorFactoryprivate ReceiveBufferSizePredictorprivate final DatagramSocket -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the address of the network interface used for multicast packets.Gets theStandardSocketOptions.IP_MULTICAST_IFoption.intGets theStandardSocketOptions.SO_RCVBUFoption.Returns theReceiveBufferSizePredictorwhich predicts the number of readable bytes in the socket receive buffer.Returns theReceiveBufferSizePredictorFactorywhich creates a newReceiveBufferSizePredictorwhen a new channel is created and noReceiveBufferSizePredictorwas set.intGets theStandardSocketOptions.SO_SNDBUFoption.intGets theStandardSocketOptions.IP_MULTICAST_TTLoption.intGets theStandardSocketOptions.IP_TOSoption.booleanGets theStandardSocketOptions.SO_BROADCASToption.booleanGets theStandardSocketOptions.IP_MULTICAST_LOOPoption.booleanGets theStandardSocketOptions.SO_REUSEADDRoption.voidsetBroadcast(boolean broadcast) Sets theStandardSocketOptions.SO_BROADCASToption.voidsetInterface(InetAddress interfaceAddress) Sets the address of the network interface used for multicast packets.voidsetLoopbackModeDisabled(boolean loopbackModeDisabled) Sets theStandardSocketOptions.IP_MULTICAST_LOOPoption.voidsetNetworkInterface(NetworkInterface networkInterface) Sets theStandardSocketOptions.IP_MULTICAST_IFoption.booleanSets a configuration property with the specified name and value.voidsetReceiveBufferSize(int receiveBufferSize) Sets theStandardSocketOptions.SO_RCVBUFoption.voidSets theReceiveBufferSizePredictorwhich predicts the number of readable bytes in the socket receive buffer.voidsetReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory) Sets theReceiveBufferSizePredictorwhich creates a newReceiveBufferSizePredictorwhen a new channel is created and noReceiveBufferSizePredictorwas set.voidsetReuseAddress(boolean reuseAddress) Sets theStandardSocketOptions.SO_REUSEADDRoption.voidsetSendBufferSize(int sendBufferSize) Sets theStandardSocketOptions.SO_SNDBUFoption.voidsetTimeToLive(int ttl) Sets theStandardSocketOptions.IP_MULTICAST_TTLoption.voidsetTrafficClass(int trafficClass) Gets theStandardSocketOptions.IP_TOSoption.Methods inherited from class org.jboss.netty.channel.DefaultChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.netty.channel.ChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
-
Field Details
-
DEFAULT_PREDICTOR_FACTORY
-
socket
-
predictor
-
predictorFactory
-
-
Constructor Details
-
DefaultDatagramChannelConfig
Creates a new instance.
-
-
Method Details
-
setOption
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
-
isBroadcast
public boolean isBroadcast()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_BROADCASToption.- Specified by:
isBroadcastin interfaceDatagramChannelConfig
-
setBroadcast
public void setBroadcast(boolean broadcast) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_BROADCASToption.- Specified by:
setBroadcastin interfaceDatagramChannelConfig
-
getInterface
Description copied from interface:DatagramChannelConfigGets the address of the network interface used for multicast packets.- Specified by:
getInterfacein interfaceDatagramChannelConfig
-
setInterface
Description copied from interface:DatagramChannelConfigSets the address of the network interface used for multicast packets.- Specified by:
setInterfacein interfaceDatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_LOOPoption.- Specified by:
isLoopbackModeDisabledin interfaceDatagramChannelConfig
-
setLoopbackModeDisabled
public void setLoopbackModeDisabled(boolean loopbackModeDisabled) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_LOOPoption.- Specified by:
setLoopbackModeDisabledin interfaceDatagramChannelConfig- Parameters:
loopbackModeDisabled-trueif and only if the loopback mode has been disabled
-
getNetworkInterface
Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_IFoption.- Specified by:
getNetworkInterfacein interfaceDatagramChannelConfig
-
setNetworkInterface
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_IFoption.- Specified by:
setNetworkInterfacein interfaceDatagramChannelConfig
-
isReuseAddress
public boolean isReuseAddress()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
isReuseAddressin interfaceDatagramChannelConfig
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
setReuseAddressin interfaceDatagramChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
getReceiveBufferSizein interfaceDatagramChannelConfig
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
setReceiveBufferSizein interfaceDatagramChannelConfig
-
getSendBufferSize
public int getSendBufferSize()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
getSendBufferSizein interfaceDatagramChannelConfig
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
setSendBufferSizein interfaceDatagramChannelConfig
-
getTimeToLive
public int getTimeToLive()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
getTimeToLivein interfaceDatagramChannelConfig
-
setTimeToLive
public void setTimeToLive(int ttl) Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
setTimeToLivein interfaceDatagramChannelConfig
-
getTrafficClass
public int getTrafficClass()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_TOSoption.- Specified by:
getTrafficClassin interfaceDatagramChannelConfig
-
setTrafficClass
public void setTrafficClass(int trafficClass) Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_TOSoption.- Specified by:
setTrafficClassin interfaceDatagramChannelConfig
-
getReceiveBufferSizePredictor
Description copied from interface:DatagramChannelConfigReturns theReceiveBufferSizePredictorwhich predicts the number of readable bytes in the socket receive buffer. The default predictor isFixedReceiveBufferSizePredictor(768).- Specified by:
getReceiveBufferSizePredictorin interfaceDatagramChannelConfig
-
setReceiveBufferSizePredictor
Description copied from interface:DatagramChannelConfigSets theReceiveBufferSizePredictorwhich predicts the number of readable bytes in the socket receive buffer. The default predictor isFixedReceiveBufferSizePredictor(768).- Specified by:
setReceiveBufferSizePredictorin interfaceDatagramChannelConfig
-
getReceiveBufferSizePredictorFactory
Description copied from interface:DatagramChannelConfigReturns theReceiveBufferSizePredictorFactorywhich creates a newReceiveBufferSizePredictorwhen a new channel is created and noReceiveBufferSizePredictorwas set. If no predictor was set for the channel,DatagramChannelConfig.setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)will be called with the new predictor. The default factory isFixedReceiveBufferSizePredictorFactory(768).- Specified by:
getReceiveBufferSizePredictorFactoryin interfaceDatagramChannelConfig
-
setReceiveBufferSizePredictorFactory
public void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory) Description copied from interface:DatagramChannelConfigSets theReceiveBufferSizePredictorwhich creates a newReceiveBufferSizePredictorwhen a new channel is created and noReceiveBufferSizePredictorwas set. If no predictor was set for the channel,DatagramChannelConfig.setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)will be called with the new predictor. The default factory isFixedReceiveBufferSizePredictorFactory(768).- Specified by:
setReceiveBufferSizePredictorFactoryin interfaceDatagramChannelConfig
-