class DefaultNioDatagramChannelConfig extends DefaultDatagramChannelConfig implements NioDatagramChannelConfig
NioSocketChannelConfig implementation.| Modifier and Type | Field and Description |
|---|---|
private java.nio.channels.DatagramChannel |
channel |
private static InternalLogger |
logger |
private int |
writeBufferHighWaterMark |
private int |
writeBufferLowWaterMark |
private int |
writeSpinCount |
| Constructor and Description |
|---|
DefaultNioDatagramChannelConfig(java.nio.channels.DatagramChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetAddress |
getInterface()
Gets the address of the network interface used for multicast packets.
|
java.net.NetworkInterface |
getNetworkInterface()
Gets the
StandardSocketOptions.IP_MULTICAST_IF option. |
int |
getTimeToLive()
Gets the
StandardSocketOptions.IP_MULTICAST_TTL option. |
int |
getWriteBufferHighWaterMark()
Returns the high water mark of the write buffer.
|
int |
getWriteBufferLowWaterMark()
Returns the low water mark of the write buffer.
|
int |
getWriteSpinCount()
Returns the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
boolean |
isLoopbackModeDisabled()
Gets the
StandardSocketOptions.IP_MULTICAST_LOOP option. |
void |
setInterface(java.net.InetAddress interfaceAddress)
Sets the address of the network interface used for multicast packets.
|
void |
setLoopbackModeDisabled(boolean loopbackModeDisabled)
Sets the
StandardSocketOptions.IP_MULTICAST_LOOP option. |
void |
setNetworkInterface(java.net.NetworkInterface networkInterface)
Sets the
StandardSocketOptions.IP_MULTICAST_IF option. |
boolean |
setOption(java.lang.String key,
java.lang.Object value)
Sets a configuration property with the specified name and value.
|
void |
setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Sets the configuration properties from the specified
Map. |
void |
setTimeToLive(int ttl)
Sets the
StandardSocketOptions.IP_MULTICAST_TTL option. |
void |
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Sets the high water mark of the write buffer.
|
private void |
setWriteBufferHighWaterMark0(int writeBufferHighWaterMark) |
void |
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Sets the low water mark of the write buffer.
|
private void |
setWriteBufferLowWaterMark0(int writeBufferLowWaterMark) |
void |
setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
getReceiveBufferSize, getReceiveBufferSizePredictor, getReceiveBufferSizePredictorFactory, getSendBufferSize, getTrafficClass, isBroadcast, isReuseAddress, setBroadcast, setReceiveBufferSize, setReceiveBufferSizePredictor, setReceiveBufferSizePredictorFactory, setReuseAddress, setSendBufferSize, setTrafficClassgetBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setPipelineFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReceiveBufferSize, getReceiveBufferSizePredictor, getReceiveBufferSizePredictorFactory, getSendBufferSize, getTrafficClass, isBroadcast, isReuseAddress, setBroadcast, setReceiveBufferSize, setReceiveBufferSizePredictor, setReceiveBufferSizePredictorFactory, setReuseAddress, setSendBufferSize, setTrafficClassgetBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setPipelineFactoryprivate static final InternalLogger logger
private volatile int writeBufferHighWaterMark
private volatile int writeBufferLowWaterMark
private volatile int writeSpinCount
private final java.nio.channels.DatagramChannel channel
DefaultNioDatagramChannelConfig(java.nio.channels.DatagramChannel channel)
public void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
ChannelConfigMap.setOptions in interface ChannelConfigsetOptions in class DefaultChannelConfigpublic boolean setOption(java.lang.String key,
java.lang.Object value)
ChannelConfig
public boolean setOption(String name, Object value) {
if (super.setOption(name, value)) {
return true;
}
if (name.equals("additionalOption")) {
....
return true;
}
return false;
}
setOption in interface ChannelConfigsetOption in class DefaultDatagramChannelConfigtrue if and only if the property has been setpublic int getWriteBufferHighWaterMark()
NioChannelConfigChannel.isWritable()
will start to return false.getWriteBufferHighWaterMark in interface NioChannelConfigpublic void setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
NioChannelConfigChannel.isWritable()
will start to return false.setWriteBufferHighWaterMark in interface NioChannelConfigprivate void setWriteBufferHighWaterMark0(int writeBufferHighWaterMark)
public int getWriteBufferLowWaterMark()
NioChannelConfigChannel.isWritable() will start to return
true again.getWriteBufferLowWaterMark in interface NioChannelConfigpublic void setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
NioChannelConfigChannel.isWritable() will start toreturn
true again.setWriteBufferLowWaterMark in interface NioChannelConfigprivate void setWriteBufferLowWaterMark0(int writeBufferLowWaterMark)
public int getWriteSpinCount()
NioChannelConfigWritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.getWriteSpinCount in interface NioChannelConfigpublic void setWriteSpinCount(int writeSpinCount)
NioChannelConfigWritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.setWriteSpinCount in interface NioChannelConfigpublic void setNetworkInterface(java.net.NetworkInterface networkInterface)
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_IF option.setNetworkInterface in interface DatagramChannelConfigsetNetworkInterface in class DefaultDatagramChannelConfigpublic java.net.NetworkInterface getNetworkInterface()
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_IF option.getNetworkInterface in interface DatagramChannelConfiggetNetworkInterface in class DefaultDatagramChannelConfigpublic int getTimeToLive()
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_TTL option.getTimeToLive in interface DatagramChannelConfiggetTimeToLive in class DefaultDatagramChannelConfigpublic void setTimeToLive(int ttl)
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_TTL option.setTimeToLive in interface DatagramChannelConfigsetTimeToLive in class DefaultDatagramChannelConfigpublic java.net.InetAddress getInterface()
DatagramChannelConfiggetInterface in interface DatagramChannelConfiggetInterface in class DefaultDatagramChannelConfigpublic void setInterface(java.net.InetAddress interfaceAddress)
DatagramChannelConfigsetInterface in interface DatagramChannelConfigsetInterface in class DefaultDatagramChannelConfigpublic boolean isLoopbackModeDisabled()
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_LOOP option.isLoopbackModeDisabled in interface DatagramChannelConfigisLoopbackModeDisabled in class DefaultDatagramChannelConfigpublic void setLoopbackModeDisabled(boolean loopbackModeDisabled)
DatagramChannelConfigStandardSocketOptions.IP_MULTICAST_LOOP option.setLoopbackModeDisabled in interface DatagramChannelConfigsetLoopbackModeDisabled in class DefaultDatagramChannelConfigloopbackModeDisabled - true if and only if the loopback mode has been disabled