commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29613] New: - Commons RLogin timeout
Date Wed, 16 Jun 2004 15:17:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29613>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29613

Commons RLogin timeout

           Summary: Commons RLogin timeout
           Product: Commons
           Version: 1.2 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mattparker@uk2.net


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;
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message