Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-24

[net] Commons RLogin timeout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 2.0
    • None
    • None
    • Operating System: All
      Platform: PC

    • 29613

    Description

      When calling the connect method on org.apache.commons.net.bsd.RLoginClient,
      timeout can take 10 minutes +.

      I have found that this is down to the RCommandClient connect method.

      The exception to catch should be a BindException. The logic here is that so
      long as we have got a valid local port and address (no BindException) then we
      shouldn't bother trying all of the other local ports. If this is adopted, then
      a connect exception is thrown from the connect method indicating that the remote
      server is not present or responding.

      Please see snippet from the corrected connect method below.

      for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT; --localPort)
      {
      try

      { _socket_ = _socketFactory_.createSocket(host, port, localAddr, localPort); }

      // catch (SocketException e)
      catch (BindException e)

      { continue; }

      break;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mattparker@uk2.net Matt Parker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: