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 Method
private static final Object
private static final Object
private static final Object
private final DatagramChannel
private static final Method
Fields inherited from class io.netty.channel.DefaultChannelConfig
channel
-
Constructor Summary
ConstructorsConstructorDescriptionNioDatagramChannelConfig
(NioDatagramChannel channel, DatagramChannel javaChannel) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Is called onceDefaultChannelConfig.setAutoRead(boolean)
is called withfalse
andDefaultChannelConfig.isAutoRead()
wastrue
before.Gets the address of the network interface used for multicast packets.Gets theStandardSocketOptions.IP_MULTICAST_IF
option.<T> T
getOption
(ChannelOption<T> option) Return the value of the givenChannelOption
private Object
getOption0
(Object option) Map
<ChannelOption<?>, Object> Return all setChannelOption
's.int
Gets theStandardSocketOptions.IP_MULTICAST_TTL
option.boolean
Gets theStandardSocketOptions.IP_MULTICAST_LOOP
option.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_LOOP
option.setNetworkInterface
(NetworkInterface networkInterface) Sets theStandardSocketOptions.IP_MULTICAST_IF
option.<T> boolean
setOption
(ChannelOption<T> option, T value) Sets a configuration property with the specified name and value.private void
setOption0
(Object option, Object value) setTimeToLive
(int ttl) Sets theStandardSocketOptions.IP_MULTICAST_TTL
option.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, setWriteSpinCount
Methods inherited from class io.netty.channel.DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:DatagramChannelConfig
Gets theStandardSocketOptions.IP_MULTICAST_TTL
option.- Specified by:
getTimeToLive
in interfaceDatagramChannelConfig
- Overrides:
getTimeToLive
in classDefaultDatagramChannelConfig
-
setTimeToLive
Description copied from interface:DatagramChannelConfig
Sets theStandardSocketOptions.IP_MULTICAST_TTL
option.- Specified by:
setTimeToLive
in interfaceDatagramChannelConfig
- Overrides:
setTimeToLive
in classDefaultDatagramChannelConfig
-
getInterface
Description copied from interface:DatagramChannelConfig
Gets the address of the network interface used for multicast packets.- Specified by:
getInterface
in interfaceDatagramChannelConfig
- Overrides:
getInterface
in classDefaultDatagramChannelConfig
-
setInterface
Description copied from interface:DatagramChannelConfig
Sets the address of the network interface used for multicast packets.- Specified by:
setInterface
in interfaceDatagramChannelConfig
- Overrides:
setInterface
in classDefaultDatagramChannelConfig
-
getNetworkInterface
Description copied from interface:DatagramChannelConfig
Gets theStandardSocketOptions.IP_MULTICAST_IF
option.- Specified by:
getNetworkInterface
in interfaceDatagramChannelConfig
- Overrides:
getNetworkInterface
in classDefaultDatagramChannelConfig
-
setNetworkInterface
Description copied from interface:DatagramChannelConfig
Sets theStandardSocketOptions.IP_MULTICAST_IF
option.- Specified by:
setNetworkInterface
in interfaceDatagramChannelConfig
- Overrides:
setNetworkInterface
in classDefaultDatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()Description copied from interface:DatagramChannelConfig
Gets theStandardSocketOptions.IP_MULTICAST_LOOP
option.- Specified by:
isLoopbackModeDisabled
in interfaceDatagramChannelConfig
- Overrides:
isLoopbackModeDisabled
in classDefaultDatagramChannelConfig
- Returns:
true
if and only if the loopback mode has been disabled
-
setLoopbackModeDisabled
Description copied from interface:DatagramChannelConfig
Sets theStandardSocketOptions.IP_MULTICAST_LOOP
option.- Specified by:
setLoopbackModeDisabled
in interfaceDatagramChannelConfig
- Overrides:
setLoopbackModeDisabled
in classDefaultDatagramChannelConfig
- Parameters:
loopbackModeDisabled
-true
if and only if the loopback mode has been disabled
-
setAutoRead
Description copied from interface:ChannelConfig
Sets 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:
setAutoRead
in interfaceChannelConfig
- Specified by:
setAutoRead
in interfaceDatagramChannelConfig
- Overrides:
setAutoRead
in classDefaultDatagramChannelConfig
-
autoReadCleared
protected void autoReadCleared()Description copied from class:DefaultChannelConfig
Is called onceDefaultChannelConfig.setAutoRead(boolean)
is called withfalse
andDefaultChannelConfig.isAutoRead()
wastrue
before.- Overrides:
autoReadCleared
in classDefaultChannelConfig
-
getOption0
-
setOption0
-
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(ChannelOption<T> option, T value) { if (super.setOption(option, value)) { return true; } if (option.equals(additionalOption)) { .... return true; } return false; }
- Specified by:
setOption
in interfaceChannelConfig
- Overrides:
setOption
in classDefaultDatagramChannelConfig
- Returns:
true
if and only if the property has been set
-
getOption
Description copied from interface:ChannelConfig
Return the value of the givenChannelOption
- Specified by:
getOption
in interfaceChannelConfig
- Overrides:
getOption
in classDefaultDatagramChannelConfig
-
getOptions
Description copied from interface:ChannelConfig
Return all setChannelOption
's.- Specified by:
getOptions
in interfaceChannelConfig
- Overrides:
getOptions
in classDefaultDatagramChannelConfig
-