GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.channel.socket
  • DefaultDatagramChannelConfig

This view

  • Original page
  • New address

GeezerVison is showing netty.io — DefaultDatagramChannelConfig (Netty API Reference (4.1.141.Final))

Class DefaultDatagramChannelConfig

java.lang.Object
io.netty.channel.DefaultChannelConfig
io.netty.channel.socket.DefaultDatagramChannelConfig
All Implemented Interfaces:
ChannelConfig, DatagramChannelConfig

public class DefaultDatagramChannelConfig extends DefaultChannelConfig implements DatagramChannelConfig
The default DatagramChannelConfig implementation.
  • Field Summary

    Fields inherited from class DefaultChannelConfig

    channel
    Modifier and Type
    Field
    Description
    protected final Channel
    channel
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultDatagramChannelConfig(DatagramChannel channel, DatagramSocket javaSocket)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    InetAddress
    getInterface()
    Gets the address of the network interface used for multicast packets.
    NetworkInterface
    getNetworkInterface()
    Gets the StandardSocketOptions.IP_MULTICAST_IF option.
    <T> T
    getOption(ChannelOption<T> option)
    Return the value of the given ChannelOption
    Map<ChannelOption<?>, Object>
    getOptions()
    Return all set ChannelOption's.
    int
    getReceiveBufferSize()
    Gets the StandardSocketOptions.SO_RCVBUF option.
    int
    getSendBufferSize()
    Gets the StandardSocketOptions.SO_SNDBUF option.
    int
    getTimeToLive()
    Gets the StandardSocketOptions.IP_MULTICAST_TTL option.
    int
    getTrafficClass()
    Gets the StandardSocketOptions.IP_TOS option.
    boolean
    isBroadcast()
    Gets the StandardSocketOptions.SO_BROADCAST option.
    boolean
    isLoopbackModeDisabled()
    Gets the StandardSocketOptions.IP_MULTICAST_LOOP option.
    boolean
    isReuseAddress()
    Gets the StandardSocketOptions.SO_REUSEADDR option.
    protected final DatagramSocket
    javaSocket()
     
    DatagramChannelConfig
    setAllocator(ByteBufAllocator allocator)
    Set the ByteBufAllocator which is used for the channel to allocate buffers.
    DatagramChannelConfig
    setAutoClose(boolean autoClose)
    Sets whether the Channel should be closed automatically and immediately on write failure.
    DatagramChannelConfig
    setAutoRead(boolean autoRead)
    Sets if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all.
    DatagramChannelConfig
    setBroadcast(boolean broadcast)
    Sets the StandardSocketOptions.SO_BROADCAST option.
    DatagramChannelConfig
    setConnectTimeoutMillis(int connectTimeoutMillis)
    Sets the connect timeout of the channel in milliseconds.
    DatagramChannelConfig
    setInterface(InetAddress interfaceAddress)
    Sets the address of the network interface used for multicast packets.
    DatagramChannelConfig
    setLoopbackModeDisabled(boolean loopbackModeDisabled)
    Sets the StandardSocketOptions.IP_MULTICAST_LOOP option.
    DatagramChannelConfig
    setMaxMessagesPerRead(int maxMessagesPerRead)
    Deprecated.
    DatagramChannelConfig
    setMaxMessagesPerWrite(int maxMessagesPerWrite)
    Set the maximum number of message to write per eventloop run.
    DatagramChannelConfig
    setMessageSizeEstimator(MessageSizeEstimator estimator)
    Set the MessageSizeEstimator which is used for the channel to detect the size of a message.
    DatagramChannelConfig
    setNetworkInterface(NetworkInterface networkInterface)
    Sets the StandardSocketOptions.IP_MULTICAST_IF option.
    <T> boolean
    setOption(ChannelOption<T> option, T value)
    Sets a configuration property with the specified name and value.
    DatagramChannelConfig
    setReceiveBufferSize(int receiveBufferSize)
    Sets the StandardSocketOptions.SO_RCVBUF option.
    DatagramChannelConfig
    setRecvByteBufAllocator(RecvByteBufAllocator allocator)
    Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
    DatagramChannelConfig
    setReuseAddress(boolean reuseAddress)
    Gets the StandardSocketOptions.SO_REUSEADDR option.
    DatagramChannelConfig
    setSendBufferSize(int sendBufferSize)
    Sets the StandardSocketOptions.SO_SNDBUF option.
    DatagramChannelConfig
    setTimeToLive(int ttl)
    Sets the StandardSocketOptions.IP_MULTICAST_TTL option.
    DatagramChannelConfig
    setTrafficClass(int trafficClass)
    Sets the StandardSocketOptions.IP_TOS option.
    DatagramChannelConfig
    setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
    Sets the high water mark of the write buffer.
    DatagramChannelConfig
    setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
    Sets the low water mark of the write buffer.
    DatagramChannelConfig
    setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
    Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
    DatagramChannelConfig
    setWriteSpinCount(int writeSpinCount)
    Sets the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value.

    Methods inherited from class DefaultChannelConfig

    autoReadCleared, getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validate
    Modifier and Type
    Method
    Description
    protected void
    autoReadCleared()
    Is called once DefaultChannelConfig.setAutoRead(boolean) is called with false and DefaultChannelConfig.isAutoRead() was true before.
    ByteBufAllocator
    getAllocator()
    Returns ByteBufAllocator which is used for the channel to allocate buffers.
    int
    getConnectTimeoutMillis()
    Returns the connect timeout of the channel in milliseconds.
    int
    getMaxMessagesPerRead()
    Deprecated.
    int
    getMaxMessagesPerWrite()
    Get the maximum number of message to write per eventloop run.
    MessageSizeEstimator
    getMessageSizeEstimator()
    Returns MessageSizeEstimator which is used for the channel to detect the size of a message.
    protected Map<ChannelOption<?>, Object>
    getOptions(Map<ChannelOption<?>, Object> result, ChannelOption<?>... options)
     
    <T extends RecvByteBufAllocator>
    T
    getRecvByteBufAllocator()
    Returns RecvByteBufAllocator which is used for the channel to allocate receive buffers.
    int
    getWriteBufferHighWaterMark()
    Returns the high water mark of the write buffer.
    int
    getWriteBufferLowWaterMark()
    Returns the low water mark of the write buffer.
    WriteBufferWaterMark
    getWriteBufferWaterMark()
    Returns the WriteBufferWaterMark which is used for setting the high and 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
    isAutoClose()
    Returns true if and only if the Channel will be closed automatically and immediately on write failure.
    boolean
    isAutoRead()
    Returns true if and only if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all.
    boolean
    setOptions(Map<ChannelOption<?>, ?> options)
    Sets the configuration properties from the specified Map.
    protected <T> void
    validate(ChannelOption<T> option, T value)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultDatagramChannelConfig

      public DefaultDatagramChannelConfig(DatagramChannel channel, DatagramSocket javaSocket)
      Creates a new instance.
  • Method Details

    • javaSocket

      protected final DatagramSocket javaSocket()
    • getOptions

      public Map<ChannelOption<?>, Object> getOptions()
      Description copied from interface: ChannelConfig
      Return all set ChannelOption's.
      Specified by:
      getOptions in interface ChannelConfig
      Overrides:
      getOptions in class DefaultChannelConfig
    • getOption

      public <T> T getOption(ChannelOption<T> option)
      Description copied from interface: ChannelConfig
      Return the value of the given ChannelOption
      Specified by:
      getOption in interface ChannelConfig
      Overrides:
      getOption in class DefaultChannelConfig
    • setOption

      public <T> boolean setOption(ChannelOption<T> option, T value)
      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 interface ChannelConfig
      Overrides:
      setOption in class DefaultChannelConfig
      Returns:
      true if and only if the property has been set
    • isBroadcast

      public boolean isBroadcast()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.SO_BROADCAST option.
      Specified by:
      isBroadcast in interface DatagramChannelConfig
    • setBroadcast

      public DatagramChannelConfig setBroadcast(boolean broadcast)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.SO_BROADCAST option.
      Specified by:
      setBroadcast in interface DatagramChannelConfig
    • getInterface

      public InetAddress getInterface()
      Description copied from interface: DatagramChannelConfig
      Gets the address of the network interface used for multicast packets.
      Specified by:
      getInterface in interface DatagramChannelConfig
    • setInterface

      public DatagramChannelConfig setInterface(InetAddress interfaceAddress)
      Description copied from interface: DatagramChannelConfig
      Sets the address of the network interface used for multicast packets.
      Specified by:
      setInterface in interface DatagramChannelConfig
    • isLoopbackModeDisabled

      public boolean isLoopbackModeDisabled()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.IP_MULTICAST_LOOP option.
      Specified by:
      isLoopbackModeDisabled in interface DatagramChannelConfig
      Returns:
      true if and only if the loopback mode has been disabled
    • setLoopbackModeDisabled

      public DatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.IP_MULTICAST_LOOP option.
      Specified by:
      setLoopbackModeDisabled in interface DatagramChannelConfig
      Parameters:
      loopbackModeDisabled - true if and only if the loopback mode has been disabled
    • getNetworkInterface

      public NetworkInterface getNetworkInterface()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.IP_MULTICAST_IF option.
      Specified by:
      getNetworkInterface in interface DatagramChannelConfig
    • setNetworkInterface

      public DatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.IP_MULTICAST_IF option.
      Specified by:
      setNetworkInterface in interface DatagramChannelConfig
    • isReuseAddress

      public boolean isReuseAddress()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.SO_REUSEADDR option.
      Specified by:
      isReuseAddress in interface DatagramChannelConfig
    • setReuseAddress

      public DatagramChannelConfig setReuseAddress(boolean reuseAddress)
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.SO_REUSEADDR option.
      Specified by:
      setReuseAddress in interface DatagramChannelConfig
    • getReceiveBufferSize

      public int getReceiveBufferSize()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.SO_RCVBUF option.
      Specified by:
      getReceiveBufferSize in interface DatagramChannelConfig
    • setReceiveBufferSize

      public DatagramChannelConfig setReceiveBufferSize(int receiveBufferSize)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.SO_RCVBUF option.
      Specified by:
      setReceiveBufferSize in interface DatagramChannelConfig
    • getSendBufferSize

      public int getSendBufferSize()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.SO_SNDBUF option.
      Specified by:
      getSendBufferSize in interface DatagramChannelConfig
    • setSendBufferSize

      public DatagramChannelConfig setSendBufferSize(int sendBufferSize)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.SO_SNDBUF option.
      Specified by:
      setSendBufferSize in interface DatagramChannelConfig
    • getTimeToLive

      public int getTimeToLive()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.IP_MULTICAST_TTL option.
      Specified by:
      getTimeToLive in interface DatagramChannelConfig
    • setTimeToLive

      public DatagramChannelConfig setTimeToLive(int ttl)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.IP_MULTICAST_TTL option.
      Specified by:
      setTimeToLive in interface DatagramChannelConfig
    • getTrafficClass

      public int getTrafficClass()
      Description copied from interface: DatagramChannelConfig
      Gets the StandardSocketOptions.IP_TOS option.
      Specified by:
      getTrafficClass in interface DatagramChannelConfig
    • setTrafficClass

      public DatagramChannelConfig setTrafficClass(int trafficClass)
      Description copied from interface: DatagramChannelConfig
      Sets the StandardSocketOptions.IP_TOS option.
      Specified by:
      setTrafficClass in interface DatagramChannelConfig
    • setWriteSpinCount

      public DatagramChannelConfig setWriteSpinCount(int writeSpinCount)
      Description copied from interface: ChannelConfig
      Sets the maximum loop count for a write operation until WritableByteChannel.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.
      Specified by:
      setWriteSpinCount in interface ChannelConfig
      Specified by:
      setWriteSpinCount in interface DatagramChannelConfig
      Overrides:
      setWriteSpinCount in class DefaultChannelConfig
    • setConnectTimeoutMillis

      public DatagramChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
      Description copied from interface: ChannelConfig
      Sets the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.
      Specified by:
      setConnectTimeoutMillis in interface ChannelConfig
      Specified by:
      setConnectTimeoutMillis in interface DatagramChannelConfig
      Overrides:
      setConnectTimeoutMillis in class DefaultChannelConfig
      Parameters:
      connectTimeoutMillis - the connect timeout in milliseconds. 0 to disable.
    • setMaxMessagesPerRead

      @Deprecated public DatagramChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
      Deprecated.
      Description copied from class: DefaultChannelConfig

      Specified by:
      setMaxMessagesPerRead in interface ChannelConfig
      Specified by:
      setMaxMessagesPerRead in interface DatagramChannelConfig
      Overrides:
      setMaxMessagesPerRead in class DefaultChannelConfig
    • setAllocator

      public DatagramChannelConfig setAllocator(ByteBufAllocator allocator)
      Description copied from interface: ChannelConfig
      Set the ByteBufAllocator which is used for the channel to allocate buffers.
      Specified by:
      setAllocator in interface ChannelConfig
      Specified by:
      setAllocator in interface DatagramChannelConfig
      Overrides:
      setAllocator in class DefaultChannelConfig
    • setRecvByteBufAllocator

      public DatagramChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
      Description copied from interface: ChannelConfig
      Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
      Specified by:
      setRecvByteBufAllocator in interface ChannelConfig
      Specified by:
      setRecvByteBufAllocator in interface DatagramChannelConfig
      Overrides:
      setRecvByteBufAllocator in class DefaultChannelConfig
    • setAutoRead

      public DatagramChannelConfig setAutoRead(boolean autoRead)
      Description copied from interface: ChannelConfig
      Sets if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't need to call it at all. The default value is true.
      Specified by:
      setAutoRead in interface ChannelConfig
      Specified by:
      setAutoRead in interface DatagramChannelConfig
      Overrides:
      setAutoRead in class DefaultChannelConfig
    • setAutoClose

      public DatagramChannelConfig setAutoClose(boolean autoClose)
      Description copied from interface: ChannelConfig
      Sets whether the Channel should be closed automatically and immediately on write failure. The default is true.
      Specified by:
      setAutoClose in interface ChannelConfig
      Specified by:
      setAutoClose in interface DatagramChannelConfig
      Overrides:
      setAutoClose in class DefaultChannelConfig
    • setWriteBufferHighWaterMark

      public DatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
      Description copied from interface: ChannelConfig

      Sets 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 return false.

      Specified by:
      setWriteBufferHighWaterMark in interface ChannelConfig
      Overrides:
      setWriteBufferHighWaterMark in class DefaultChannelConfig
    • setWriteBufferLowWaterMark

      public DatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
      Description copied from interface: ChannelConfig

      Sets 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 return true again.

      Specified by:
      setWriteBufferLowWaterMark in interface ChannelConfig
      Overrides:
      setWriteBufferLowWaterMark in class DefaultChannelConfig
    • setWriteBufferWaterMark

      public DatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
      Description copied from interface: ChannelConfig
      Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
      Specified by:
      setWriteBufferWaterMark in interface ChannelConfig
      Specified by:
      setWriteBufferWaterMark in interface DatagramChannelConfig
      Overrides:
      setWriteBufferWaterMark in class DefaultChannelConfig
    • setMessageSizeEstimator

      public DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
      Description copied from interface: ChannelConfig
      Set the MessageSizeEstimator which is used for the channel to detect the size of a message.
      Specified by:
      setMessageSizeEstimator in interface ChannelConfig
      Specified by:
      setMessageSizeEstimator in interface DatagramChannelConfig
      Overrides:
      setMessageSizeEstimator in class DefaultChannelConfig
    • setMaxMessagesPerWrite

      public DatagramChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite)
      Description copied from class: DefaultChannelConfig
      Set 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:
      setMaxMessagesPerWrite in class DefaultChannelConfig
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.