Class KQueueDatagramChannelConfig
java.lang.Object
io.netty.channel.DefaultChannelConfig
io.netty.channel.kqueue.KQueueChannelConfig
io.netty.channel.kqueue.KQueueDatagramChannelConfig
- All Implemented Interfaces:
ChannelConfig, DatagramChannelConfig
public final class KQueueDatagramChannelConfig
extends KQueueChannelConfig
implements DatagramChannelConfig
-
Field Summary
Fields inherited from class DefaultChannelConfig
channel -
Method Summary
Modifier and TypeMethodDescriptionGets 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 givenChannelOptionMap<ChannelOption<?>, Object> Return all setChannelOption's.intGets theStandardSocketOptions.SO_RCVBUFoption.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.booleanReturnstrueif the SO_REUSEPORT option is set.setAllocator(ByteBufAllocator allocator) Set theByteBufAllocatorwhich is used for the channel to allocate buffers.setAutoClose(boolean autoClose) Sets whether theChannelshould be closed automatically and immediately on write failure.setAutoRead(boolean autoRead) Sets ifChannelHandlerContext.read()will be invoked automatically so that a user application doesn't need to call it at all.setBroadcast(boolean broadcast) Sets theStandardSocketOptions.SO_BROADCASToption.setConnectTimeoutMillis(int connectTimeoutMillis) Sets the connect timeout of the channel in milliseconds.setInterface(InetAddress interfaceAddress) Sets the address of the network interface used for multicast packets.setLoopbackModeDisabled(boolean loopbackModeDisabled) Sets theStandardSocketOptions.IP_MULTICAST_LOOPoption.setMaxMessagesPerRead(int maxMessagesPerRead) Deprecated.setMaxMessagesPerWrite(int maxMessagesPerWrite) Set the maximum number of message to write per eventloop run.setMessageSizeEstimator(MessageSizeEstimator estimator) Set theMessageSizeEstimatorwhich is used for the channel to detect the size of a message.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.setRcvAllocTransportProvidesGuess(boolean transportProvidesGuess) If this istruethen theRecvByteBufAllocator.Handle.guess()will be overridden to always attempt to read as many bytes as kqueue says are available.setReceiveBufferSize(int receiveBufferSize) Sets theStandardSocketOptions.SO_RCVBUFoption.setRecvByteBufAllocator(RecvByteBufAllocator allocator) Set theRecvByteBufAllocatorwhich is used for the channel to allocate receive buffers.setReuseAddress(boolean reuseAddress) Gets theStandardSocketOptions.SO_REUSEADDRoption.setReusePort(boolean reusePort) Set the SO_REUSEPORT option on the underlying Channel.setSendBufferSize(int sendBufferSize) Sets theStandardSocketOptions.SO_SNDBUFoption.setTimeToLive(int ttl) Sets theStandardSocketOptions.IP_MULTICAST_TTLoption.setTrafficClass(int trafficClass) Sets theStandardSocketOptions.IP_TOSoption.setWriteBufferHighWaterMark(int writeBufferHighWaterMark) Deprecated.setWriteBufferLowWaterMark(int writeBufferLowWaterMark) Deprecated.setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) Set theWriteBufferWaterMarkwhich is used for setting the high and low water mark of the write buffer.setWriteSpinCount(int writeSpinCount) Sets the maximum loop count for a write operation untilWritableByteChannel.write(ByteBuffer)returns a non-zero value.Methods inherited from class KQueueChannelConfig
autoReadCleared, getRcvAllocTransportProvidesGuessMethods inherited from class DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validate
-
Method Details
-
getOptions
Description copied from interface:ChannelConfigReturn all setChannelOption's.- Specified by:
getOptionsin interfaceChannelConfig- Overrides:
getOptionsin classKQueueChannelConfig
-
getOption
Description copied from interface:ChannelConfigReturn the value of the givenChannelOption- Specified by:
getOptionin interfaceChannelConfig- Overrides:
getOptionin classKQueueChannelConfig
-
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 classKQueueChannelConfig- Returns:
trueif and only if the property has been set
-
isReusePort
public boolean isReusePort()Returnstrueif the SO_REUSEPORT option is set. -
setReusePort
Set the SO_REUSEPORT option on the underlying Channel. This will allow to bind multipleKQueueSocketChannels to the same port and so accept connections with multiple threads. Be aware this method needs be called beforeChannel.bind(java.net.SocketAddress)to have any affect. -
setRcvAllocTransportProvidesGuess
public KQueueDatagramChannelConfig setRcvAllocTransportProvidesGuess(boolean transportProvidesGuess) Description copied from class:KQueueChannelConfigIf this istruethen theRecvByteBufAllocator.Handle.guess()will be overridden to always attempt to read as many bytes as kqueue says are available.- Overrides:
setRcvAllocTransportProvidesGuessin classKQueueChannelConfig
-
setMessageSizeEstimator
Description copied from interface:ChannelConfigSet theMessageSizeEstimatorwhich is used for the channel to detect the size of a message.- Specified by:
setMessageSizeEstimatorin interfaceChannelConfig- Specified by:
setMessageSizeEstimatorin interfaceDatagramChannelConfig- Overrides:
setMessageSizeEstimatorin classKQueueChannelConfig
-
setWriteBufferLowWaterMark
@Deprecated public KQueueDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) Deprecated.Description copied from interface:ChannelConfigSets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value,
Channel.isWritable()will start to returntrueagain.- Specified by:
setWriteBufferLowWaterMarkin interfaceChannelConfig- Overrides:
setWriteBufferLowWaterMarkin classKQueueChannelConfig
-
setWriteBufferHighWaterMark
@Deprecated public KQueueDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) Deprecated.Description copied from interface:ChannelConfigSets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value,
Channel.isWritable()will start to returnfalse.- Specified by:
setWriteBufferHighWaterMarkin interfaceChannelConfig- Overrides:
setWriteBufferHighWaterMarkin classKQueueChannelConfig
-
setWriteBufferWaterMark
public KQueueDatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) Description copied from interface:ChannelConfigSet theWriteBufferWaterMarkwhich is used for setting the high and low water mark of the write buffer.- Specified by:
setWriteBufferWaterMarkin interfaceChannelConfig- Specified by:
setWriteBufferWaterMarkin interfaceDatagramChannelConfig- Overrides:
setWriteBufferWaterMarkin classKQueueChannelConfig
-
setAutoClose
Description copied from interface:ChannelConfigSets whether theChannelshould be closed automatically and immediately on write failure. The default istrue.- Specified by:
setAutoClosein interfaceChannelConfig- Specified by:
setAutoClosein interfaceDatagramChannelConfig- Overrides:
setAutoClosein classDefaultChannelConfig
-
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 classKQueueChannelConfig
-
setRecvByteBufAllocator
Description copied from interface:ChannelConfigSet theRecvByteBufAllocatorwhich is used for the channel to allocate receive buffers.- Specified by:
setRecvByteBufAllocatorin interfaceChannelConfig- Specified by:
setRecvByteBufAllocatorin interfaceDatagramChannelConfig- Overrides:
setRecvByteBufAllocatorin classKQueueChannelConfig
-
setWriteSpinCount
Description copied from interface:ChannelConfigSets the maximum loop count for a write operation untilWritableByteChannel.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 is16.- Specified by:
setWriteSpinCountin interfaceChannelConfig- Specified by:
setWriteSpinCountin interfaceDatagramChannelConfig- Overrides:
setWriteSpinCountin classKQueueChannelConfig
-
setAllocator
Description copied from interface:ChannelConfigSet theByteBufAllocatorwhich is used for the channel to allocate buffers.- Specified by:
setAllocatorin interfaceChannelConfig- Specified by:
setAllocatorin interfaceDatagramChannelConfig- Overrides:
setAllocatorin classKQueueChannelConfig
-
setConnectTimeoutMillis
Description copied from interface:ChannelConfigSets the connect timeout of the channel in milliseconds. If theChanneldoes not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillisin interfaceChannelConfig- Specified by:
setConnectTimeoutMillisin interfaceDatagramChannelConfig- Overrides:
setConnectTimeoutMillisin classKQueueChannelConfig- Parameters:
connectTimeoutMillis- the connect timeout in milliseconds.0to disable.
-
setMaxMessagesPerRead
Deprecated.Description copied from class:DefaultChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceDatagramChannelConfig- Overrides:
setMaxMessagesPerReadin classKQueueChannelConfig
-
getSendBufferSize
public int getSendBufferSize()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
getSendBufferSizein interfaceDatagramChannelConfig
-
setSendBufferSize
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_SNDBUFoption.- Specified by:
setSendBufferSizein interfaceDatagramChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
getReceiveBufferSizein interfaceDatagramChannelConfig
-
setReceiveBufferSize
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_RCVBUFoption.- Specified by:
setReceiveBufferSizein interfaceDatagramChannelConfig
-
getTrafficClass
public int getTrafficClass()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_TOSoption.- Specified by:
getTrafficClassin interfaceDatagramChannelConfig
-
setTrafficClass
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_TOSoption.- Specified by:
setTrafficClassin interfaceDatagramChannelConfig
-
isReuseAddress
public boolean isReuseAddress()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
isReuseAddressin interfaceDatagramChannelConfig
-
setReuseAddress
Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_REUSEADDRoption.- Specified by:
setReuseAddressin interfaceDatagramChannelConfig
-
isBroadcast
public boolean isBroadcast()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.SO_BROADCASToption.- Specified by:
isBroadcastin interfaceDatagramChannelConfig
-
setBroadcast
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.SO_BROADCASToption.- Specified by:
setBroadcastin interfaceDatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_LOOPoption.- Specified by:
isLoopbackModeDisabledin interfaceDatagramChannelConfig- 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- Parameters:
loopbackModeDisabled-trueif and only if the loopback mode has been disabled
-
getTimeToLive
public int getTimeToLive()Description copied from interface:DatagramChannelConfigGets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
getTimeToLivein interfaceDatagramChannelConfig
-
setTimeToLive
Description copied from interface:DatagramChannelConfigSets theStandardSocketOptions.IP_MULTICAST_TTLoption.- Specified by:
setTimeToLivein 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
-
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
-
setMaxMessagesPerWrite
Description copied from class:DefaultChannelConfigSet the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages.- Overrides:
setMaxMessagesPerWritein classDefaultChannelConfig
-