Class DefaultSocketSessionConfig

    • Constructor Detail

      • DefaultSocketSessionConfig

        public DefaultSocketSessionConfig()
        Creates a new instance.
    • Method Detail

      • init

        public void init​(IoService parent)
        Initialize this configuration.
        Parameters:
        parent - The parent IoService.
      • isReuseAddress

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

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

        public void setReceiveBufferSize​(int receiveBufferSize)
        Parameters:
        receiveBufferSize - The size of the receive buffer
        See Also:
        Socket.setReceiveBufferSize(int)
      • setSendBufferSize

        public void setSendBufferSize​(int sendBufferSize)
        Parameters:
        sendBufferSize - The size of the send buffer
        See Also:
        Socket.setSendBufferSize(int)
      • 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:
        Socket.setTrafficClass(int)
      • isKeepAlive

        public boolean isKeepAlive()
        Returns:
        true if SO_KEEPALIVE is enabled.
        See Also:
        Socket.getKeepAlive()
      • setKeepAlive

        public void setKeepAlive​(boolean keepAlive)
        Parameters:
        keepAlive - if SO_KEEPALIVE is to be enabled
        See Also:
        Socket.setKeepAlive(boolean)
      • isOobInline

        public boolean isOobInline()
        Returns:
        true if SO_OOBINLINE is enabled.
        See Also:
        Socket.getOOBInline()
      • setOobInline

        public void setOobInline​(boolean oobInline)
        Parameters:
        oobInline - if SO_OOBINLINE is to be enabled
        See Also:
        Socket.setOOBInline(boolean)
      • getSoLinger

        public int getSoLinger()
        Please note that enabling SO_LINGER in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
        Returns:
        The value for SO_LINGER
        See Also:
        Socket.getSoLinger(), Sun Bug Database
      • setSoLinger

        public void setSoLinger​(int soLinger)
        Please note that enabling SO_LINGER in Java NIO can result in platform-dependent behaviour and unexpected blocking of I/O thread.
        Parameters:
        soLinger - Please specify a negative value to disable SO_LINGER.
        See Also:
        Socket.setSoLinger(boolean, int), Sun Bug Database
      • isTcpNoDelay

        public boolean isTcpNoDelay()
        Returns:
        true if TCP_NODELAY is enabled.
        See Also:
        Socket.getTcpNoDelay()
      • setTcpNoDelay

        public void setTcpNoDelay​(boolean tcpNoDelay)
        Parameters:
        tcpNoDelay - true if TCP_NODELAY is to be enabled
        See Also:
        Socket.setTcpNoDelay(boolean)
      • isKeepAliveChanged

        protected boolean isKeepAliveChanged()
        Overrides:
        isKeepAliveChanged in class AbstractSocketSessionConfig
        Returns:
        true if and only if the keepAlive 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.
      • isOobInlineChanged

        protected boolean isOobInlineChanged()
        Overrides:
        isOobInlineChanged in class AbstractSocketSessionConfig
        Returns:
        true if and only if the oobInline 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 AbstractSocketSessionConfig
        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 AbstractSocketSessionConfig
        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 AbstractSocketSessionConfig
        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.
      • isSoLingerChanged

        protected boolean isSoLingerChanged()
        Overrides:
        isSoLingerChanged in class AbstractSocketSessionConfig
        Returns:
        true if and only if the soLinger 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.
      • isTcpNoDelayChanged

        protected boolean isTcpNoDelayChanged()
        Overrides:
        isTcpNoDelayChanged in class AbstractSocketSessionConfig
        Returns:
        true if and only if the tcpNoDelay 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 AbstractSocketSessionConfig
        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.