Class SocketOptions

    • Constructor Detail

      • SocketOptions

        public SocketOptions()
    • Method Detail

      • apply

        public void apply​(java.net.Socket socket)
                   throws java.net.SocketException
        Applies the values in this builder to the given socket.
        Parameters:
        socket - The target Socket.
        Throws:
        java.net.SocketException - if there is an error in the underlying protocol, such as a TCP error.
      • build

        public SocketOptions build()
        Description copied from interface: Builder
        Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.
        Specified by:
        build in interface Builder<SocketOptions>
        Returns:
        the configured instance.
      • getActualTrafficClass

        public java.lang.Integer getActualTrafficClass()
        See Socket.setTrafficClass(int).
        Returns:
        the value to apply to a Socket.
      • getPerformancePreferences

        public SocketPerformancePreferences getPerformancePreferences()
        See Socket.setPerformancePreferences(int, int, int).
        Returns:
        this.
      • getReceiveBufferSize

        public java.lang.Integer getReceiveBufferSize()
        See Socket.setReceiveBufferSize(int).
        Returns:
        the value to apply to a Socket.
      • getRfc1349TrafficClass

        public Rfc1349TrafficClass getRfc1349TrafficClass()
        See Socket.setTrafficClass(int).
        Returns:
        the value to apply to a Socket.
      • getSendBufferSize

        public java.lang.Integer getSendBufferSize()
        See Socket.setSendBufferSize(int).
        Returns:
        the value to apply to a Socket.
      • getSoLinger

        public java.lang.Integer getSoLinger()
        See Socket.setSoLinger(boolean, int).
        Returns:
        the value to apply to a Socket.
      • getSoTimeout

        public java.lang.Integer getSoTimeout()
        See Socket.setSoTimeout(int).
        Returns:
        the value to apply to a Socket.
      • getTrafficClass

        public java.lang.Integer getTrafficClass()
        See Socket.setTrafficClass(int).
        Returns:
        the value to apply to a Socket.
      • isKeepAlive

        public java.lang.Boolean isKeepAlive()
        See Socket.setKeepAlive(boolean).
        Returns:
        the value to apply to a Socket.
      • isOobInline

        public java.lang.Boolean isOobInline()
        See Socket.setOOBInline(boolean).
        Returns:
        the value to apply to a Socket.
      • isReuseAddress

        public java.lang.Boolean isReuseAddress()
        See Socket.setReuseAddress(boolean).
        Returns:
        the value to apply to a Socket.
      • isTcpNoDelay

        public java.lang.Boolean isTcpNoDelay()
        See Socket.setTcpNoDelay(boolean).
        Returns:
        the value to apply to a Socket.
      • setKeepAlive

        public SocketOptions setKeepAlive​(boolean keepAlive)
        See Socket.setKeepAlive(boolean).
        Parameters:
        keepAlive - See Socket.setKeepAlive(boolean).
        Returns:
        this.
      • setOobInline

        public SocketOptions setOobInline​(boolean oobInline)
        See Socket.setOOBInline(boolean).
        Parameters:
        oobInline - See Socket.setOOBInline(boolean).
        Returns:
        this.
      • setPerformancePreferences

        public SocketOptions setPerformancePreferences​(SocketPerformancePreferences performancePreferences)
        See Socket.setPerformancePreferences(int, int, int).
        Parameters:
        performancePreferences - See Socket.setPerformancePreferences(int, int, int).
        Returns:
        this.
      • setReceiveBufferSize

        public SocketOptions setReceiveBufferSize​(int receiveBufferSize)
        See Socket.setReceiveBufferSize(int).
        Parameters:
        receiveBufferSize - See Socket.setReceiveBufferSize(int).
        Returns:
        this.
      • setReuseAddress

        public SocketOptions setReuseAddress​(boolean reuseAddress)
        See Socket.setReuseAddress(boolean).
        Parameters:
        reuseAddress - See Socket.setReuseAddress(boolean).
        Returns:
        this.
      • setRfc1349TrafficClass

        public SocketOptions setRfc1349TrafficClass​(Rfc1349TrafficClass trafficClass)
        See Socket.setTrafficClass(int).
        Parameters:
        trafficClass - See Socket.setTrafficClass(int).
        Returns:
        the value to apply to a Socket.
      • setSendBufferSize

        public SocketOptions setSendBufferSize​(int sendBufferSize)
        See Socket.setSendBufferSize(int).
        Parameters:
        sendBufferSize - See Socket.setSendBufferSize(int).
        Returns:
        this.
      • setSoLinger

        public SocketOptions setSoLinger​(int soLinger)
        See Socket.setSoLinger(boolean, int).
        Parameters:
        soLinger - See Socket.setSoLinger(boolean, int).
        Returns:
        this.
      • setSoTimeout

        public SocketOptions setSoTimeout​(int soTimeout)
        See Socket.setSoTimeout(int).
        Parameters:
        soTimeout - See Socket.setSoTimeout(int).
        Returns:
        this.
      • setTcpNoDelay

        public SocketOptions setTcpNoDelay​(boolean tcpNoDelay)
        See Socket.setTcpNoDelay(boolean).
        Parameters:
        tcpNoDelay - See Socket.setTcpNoDelay(boolean).
        Returns:
        this.
      • setTrafficClass

        public SocketOptions setTrafficClass​(int trafficClass)
        See Socket.setTrafficClass(int).
        Parameters:
        trafficClass - See Socket.setTrafficClass(int).
        Returns:
        this.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object