Class DefaultDatagramSessionConfig

All Implemented Interfaces:
IoSessionConfig, DatagramSessionConfig

public class DefaultDatagramSessionConfig extends AbstractDatagramSessionConfig
A default implementation of DatagramSessionConfig.
  • Field Details

    • DEFAULT_BROADCAST

      private static final boolean DEFAULT_BROADCAST
      See Also:
    • DEFAULT_REUSE_ADDRESS

      private static final boolean DEFAULT_REUSE_ADDRESS
      See Also:
    • DEFAULT_RECEIVE_BUFFER_SIZE

      private static final int DEFAULT_RECEIVE_BUFFER_SIZE
      See Also:
    • DEFAULT_SEND_BUFFER_SIZE

      private static final int DEFAULT_SEND_BUFFER_SIZE
      See Also:
    • DEFAULT_TRAFFIC_CLASS

      private static final int DEFAULT_TRAFFIC_CLASS
      See Also:
    • broadcast

      private boolean broadcast
    • reuseAddress

      private boolean reuseAddress
    • receiveBufferSize

      private int receiveBufferSize
    • sendBufferSize

      private int sendBufferSize
    • trafficClass

      private int trafficClass
  • Constructor Details

    • DefaultDatagramSessionConfig

      public DefaultDatagramSessionConfig()
      Creates a new instance.
  • Method Details

    • isBroadcast

      public boolean isBroadcast()
      Returns:
      true if SO_BROADCAST is enabled.
      See Also:
    • setBroadcast

      public void setBroadcast(boolean broadcast)
      Parameters:
      broadcast - Tells if SO_BROACAST is enabled or not
      See Also:
    • isReuseAddress

      public boolean isReuseAddress()
      Returns:
      true if SO_REUSEADDR is enabled.
      See Also:
    • setReuseAddress

      public void setReuseAddress(boolean reuseAddress)
      Parameters:
      reuseAddress - Tells if SO_REUSEADDR is enabled or disabled
      See Also:
    • getReceiveBufferSize

      public int getReceiveBufferSize()
      Returns:
      the size of the receive buffer
      See Also:
    • setReceiveBufferSize

      public void setReceiveBufferSize(int receiveBufferSize)
      Parameters:
      receiveBufferSize - The size of the receive buffer
      See Also:
    • getSendBufferSize

      public int getSendBufferSize()
      Returns:
      the size of the send buffer
      See Also:
    • setSendBufferSize

      public void setSendBufferSize(int sendBufferSize)
      Parameters:
      sendBufferSize - The size of the send buffer
      See Also:
    • getTrafficClass

      public int getTrafficClass()
      Returns:
      the traffic class
      See Also:
    • setTrafficClass

      public void setTrafficClass(int trafficClass)
      Parameters:
      trafficClass - The traffic class to set, one of IPTOS_LOWCOST (0x02) IPTOS_RELIABILITY (0x04), IPTOS_THROUGHPUT (0x08) or IPTOS_LOWDELAY (0x10)
      See Also:
    • isBroadcastChanged

      protected boolean isBroadcastChanged()
      Overrides:
      isBroadcastChanged in class AbstractDatagramSessionConfig
      Returns:
      true if and only if the broadcast property has been changed by its setter method. The system call related with the property is made only when this method returns true. By default, this method always returns true to simplify implementation of subclasses, but overriding the default behavior is always encouraged.
    • isReceiveBufferSizeChanged

      protected boolean isReceiveBufferSizeChanged()
      Overrides:
      isReceiveBufferSizeChanged in class AbstractDatagramSessionConfig
      Returns:
      true if and only if the receiveBufferSize property has been changed by its setter method. The system call related with the property is made only when this method returns true. By default, this method always returns true to simplify implementation of subclasses, but overriding the default behavior is always encouraged.
    • isReuseAddressChanged

      protected boolean isReuseAddressChanged()
      Overrides:
      isReuseAddressChanged in class AbstractDatagramSessionConfig
      Returns:
      true if and only if the reuseAddress property has been changed by its setter method. The system call related with the property is made only when this method returns true. By default, this method always returns true to simplify implementation of subclasses, but overriding the default behavior is always encouraged.
    • isSendBufferSizeChanged

      protected boolean isSendBufferSizeChanged()
      Overrides:
      isSendBufferSizeChanged in class AbstractDatagramSessionConfig
      Returns:
      true if and only if the sendBufferSize property has been changed by its setter method. The system call related with the property is made only when this method returns true. By default, this method always returns true to simplify implementation of subclasses, but overriding the default behavior is always encouraged.
    • isTrafficClassChanged

      protected boolean isTrafficClassChanged()
      Overrides:
      isTrafficClassChanged in class AbstractDatagramSessionConfig
      Returns:
      true if and only if the trafficClass property has been changed by its setter method. The system call related with the property is made only when this method returns true. By default, this method always returns true to simplify implementation of subclasses, but overriding the default behavior is always encouraged.