Package io.netty.channel.socket.nio
Class NioDatagramChannelConfig
java.lang.Object
io.netty.channel.DefaultChannelConfig
io.netty.channel.socket.DefaultDatagramChannelConfig
io.netty.channel.socket.nio.NioDatagramChannelConfig
- All Implemented Interfaces:
ChannelConfig,DatagramChannelConfig
The default
NioDatagramChannelConfig implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Methodprivate static final Objectprivate static final Objectprivate static final Objectprivate final DatagramChannelprivate static final MethodFields inherited from class io.netty.channel.DefaultChannelConfig
channel -
Constructor Summary
ConstructorsConstructorDescriptionNioDatagramChannelConfig(NioDatagramChannel channel, DatagramChannel javaChannel) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidIs called onceDefaultChannelConfig.setAutoRead(boolean)is called withfalseandDefaultChannelConfig.isAutoRead()wastruebefore.Gets the address of the network interface used for multicast packets.Gets theStandardSocketOptions.IP_MULTICAST_IFoption.<T> TgetOption(ChannelOption<T> option) Return the value of the givenChannelOptionprivate ObjectgetOption0(Object option) Map<ChannelOption<?>, Object> Return all setChannelOption's.intGets theStandardSocketOptions.IP_MULTICAST_TTLoption.booleanGets theStandardSocketOptions.IP_MULTICAST_LOOPoption.setAutoRead(boolean autoRead) Sets ifChannelHandlerContext.read()will be invoked automatically so that a user application doesn't need to call it at all.setInterface(InetAddress interfaceAddress) Sets the address of the network interface used for multicast packets.setLoopbackModeDisabled(boolean loopbackModeDisabled) Sets theStandardSocketOptions.IP_MULTICAST_LOOPoption.setNetworkInterface(NetworkInterface networkInterface) Sets theStandardSocketOptions.IP_MULTICAST_IFoption.<T> booleansetOption(ChannelOption<T> option, T value) Sets a configuration property with the specified name and value.private voidsetOption0(Object option, Object value) setTimeToLive(int ttl) Sets theStandardSocketOptions.IP_MULTICAST_TTLoption.Methods inherited from class io.netty.channel.socket.DefaultDatagramChannelConfig
getReceiveBufferSize, getSendBufferSize, getTrafficClass, isBroadcast, isReuseAddress, javaSocket, setAllocator, setAutoClose, setBroadcast, setConnectTimeoutMillis, setMaxMessagesPerRead, setMaxMessagesPerWrite, setMessageSizeEstimator, setReceiveBufferSize, setRecvByteBufAllocator, setReuseAddress, setSendBufferSize, setTrafficClass, setWriteBufferHighWaterMark, setWriteBufferLowWaterMark, setWriteBufferWaterMark, setWriteSpinCountMethods inherited from class io.netty.channel.DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions
-
Field Details
-
IP_MULTICAST_TTL
-
IP_MULTICAST_IF
-
IP_MULTICAST_LOOP
-
GET_OPTION
-
SET_OPTION
-
javaChannel
-
-
Constructor Details
-
NioDatagramChannelConfig
NioDatagramChannelConfig(NioDatagramChannel channel, DatagramChannel javaChannel)
-
-
Method Details
-
getTimeToLive
public int getTimeToLive()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
getTimeToLivein interfaceDatagramChannelConfig- Overrides:
getTimeToLivein classDefaultDatagramChannelConfig
-
setTimeToLive
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
setTimeToLivein interfaceDatagramChannelConfig- Overrides:
setTimeToLivein classDefaultDatagramChannelConfig
-
getInterface
Description copied from interface:DatagramChannelConfigGets the address of the network interface used for multicast packets.- Specified by:
getInterfacein interfaceDatagramChannelConfig- Overrides:
getInterfacein classDefaultDatagramChannelConfig
-
setInterface
Description copied from interface:DatagramChannelConfigSets the address of the network interface used for multicast packets.- Specified by:
setInterfacein interfaceDatagramChannelConfig- Overrides:
setInterfacein classDefaultDatagramChannelConfig
-
getNetworkInterface
Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_IFoption.- Specified by:
getNetworkInterfacein interfaceDatagramChannelConfig- Overrides:
getNetworkInterfacein classDefaultDatagramChannelConfig
-
setNetworkInterface
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_IFoption.- Specified by:
setNetworkInterfacein interfaceDatagramChannelConfig- Overrides:
setNetworkInterfacein classDefaultDatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_LOOPoption.- Specified by:
isLoopbackModeDisabledin interfaceDatagramChannelConfig- Overrides:
isLoopbackModeDisabledin classDefaultDatagramChannelConfig- Returns:
trueif and only if the loopback mode has been disabled
-
setLoopbackModeDisabled
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_LOOPoption.- Specified by:
setLoopbackModeDisabledin interfaceDatagramChannelConfig- Overrides:
setLoopbackModeDisabledin classDefaultDatagramChannelConfig- Parameters:
loopbackModeDisabled-trueif and only if the loopback mode has been disabled
-
setAutoRead
Description copied from interface:ChannelConfigSets ifChannelHandlerContext.read()will be invoked automatically so that a user application doesn't need to call it at all. The default value istrue.- Specified by:
setAutoReadin interfaceChannelConfig- Specified by:
setAutoReadin interfaceDatagramChannelConfig- Overrides:
setAutoReadin classDefaultDatagramChannelConfig
-
autoReadCleared
protected void autoReadCleared()Description copied from class:DefaultChannelConfigIs called onceDefaultChannelConfig.setAutoRead(boolean)is called withfalseandDefaultChannelConfig.isAutoRead()wastruebefore.- Overrides:
autoReadClearedin classDefaultChannelConfig
-
getOption0
-
setOption0
-
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(ChannelOption<T> option, T value) { if (super.setOption(option, value)) { return true; } if (option.equals(additionalOption)) { .... return true; } return false; }- Specified by:
setOptionin interfaceChannelConfig- Overrides:
setOptionin classDefaultDatagramChannelConfig- Returns:
trueif and only if the property has been set
-
getOption
Description copied from interface:ChannelConfigReturn the value of the givenChannelOption- Specified by:
getOptionin interfaceChannelConfig- Overrides:
getOptionin classDefaultDatagramChannelConfig
-
getOptions
Description copied from interface:ChannelConfigReturn all setChannelOption's.- Specified by:
getOptionsin interfaceChannelConfig- Overrides:
getOptionsin classDefaultDatagramChannelConfig
-