Class SocketTimeoutTask

    • Constructor Summary

      Constructors 
      Constructor Description
      SocketTimeoutTask​(java.lang.Runnable actualTask)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setSocketTimeout​(java.time.Duration timeout)
      Sets the receive timeout, automatically killing the connection if no messages are received for this long
      void setTimeoutEnabled​(boolean timeoutEnabled)
      Enables or disables the timeout entirely.
      • Methods inherited from class java.lang.Object

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

      • SocketTimeoutTask

        public SocketTimeoutTask​(java.lang.Runnable actualTask)
    • Method Detail

      • setTimeoutEnabled

        public final void setTimeoutEnabled​(boolean timeoutEnabled)

        Enables or disables the timeout entirely. This may be useful if you want to store the timeout value but wish to temporarily disable/enable timeouts.

        The default is for timeoutEnabled to be true but timeout to be set to Duration.ZERO (ie disabled).

        This call will reset the current progress towards the timeout.

        Specified by:
        setTimeoutEnabled in interface TimeoutHandler
      • setSocketTimeout

        public final void setSocketTimeout​(java.time.Duration timeout)

        Sets the receive timeout, automatically killing the connection if no messages are received for this long

        A timeout of Duration.ZERO is interpreted as no timeout.

        The default is for timeoutEnabled to be true but timeout to be set to Duration.ZERO (ie disabled).

        This call will reset the current progress towards the timeout.

        Specified by:
        setSocketTimeout in interface TimeoutHandler