Class TftpServerImpl

    • Constructor Detail

      • TftpServerImpl

        public TftpServerImpl()
    • Method Detail

      • getMaxTimeoutRetries

        public int getMaxTimeoutRetries()
        Get the current value for maxTimeoutRetries
        Returns:
        the max allowed number of retries
      • getSocketTimeout

        public int getSocketTimeout()
        The current socket timeout used during transfers in milliseconds.
        Returns:
        the timeout value
      • isRunning

        public boolean isRunning()
                          throws Exception
        check if the server thread is still running.
        Returns:
        true if running, false if stopped.
        Throws:
        Exception - throws the exception that stopped the server if the server is stopped from an exception.
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • setMaxTimeoutRetries

        public void setMaxTimeoutRetries​(int retries)
        Set the max number of retries in response to a timeout. Default 3. Min 0.
        Parameters:
        retries - number of retries, must be > 0
      • setSocketTimeout

        public void setSocketTimeout​(int timeout)
        Set the socket timeout in milliseconds used in transfers. Defaults to the value here: https://commons.apache.org/net/apidocs/org/apache/commons/net/tftp/TFTP.html#DEFAULT_TIMEOUT (5000 at the time I write this) Min value of 10.
        Parameters:
        timeout - the timeout; must be larger than 10
      • setPort

        public void setPort​(int port)
      • setMaximumReceiveSize

        public void setMaximumReceiveSize​(long maximumReceiveSize)
      • close

        public void close()
        Stop the tftp server (and any currently running transfers) and release all opened network resources.
        Specified by:
        close in interface AutoCloseable