[
https://issues.apache.org/jira/browse/NET-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627981#action_12627981
]
Ivaylo Ivanov commented on NET-24:
----------------------------------
I don't think the bug is fixed in 2.0. The following code is from Revision
658518:
for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT;
--localPort)
{
try
{
_socket_ =
_socketFactory_.createSocket(host, port, localAddr,
localPort);
}
catch (BindException be) {
continue;
}
catch (SocketException e)
{
continue;
}
break;
}
if (localPort < MIN_CLIENT_PORT)
throw new BindException("All ports in use or insufficient
permssion.");
_connectAction_();
}
To fix the bug the "catch (SocketException e)" has to be removed completely.
> [net] Commons RLogin timeout
> ----------------------------
>
> Key: NET-24
> URL: https://issues.apache.org/jira/browse/NET-24
> Project: Commons Net
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Operating System: All
> Platform: PC
> Reporter: Matt Parker
> Fix For: 2.0
>
>
> 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;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.