[
https://issues.apache.org/jira/browse/DIRMINA-839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17470948#comment-17470948
]
Eduardo Quintanilla commented on DIRMINA-839:
---------------------------------------------
Thanks [~elecharny] I mean using something like this example. I will look into
the internal code.
{code:java}
public Integer getAvailablePort(final Integer port) throws IOException {
if (org.apache.mina.util.AvailablePortFinder.available(port)) {
return port;
}
return org.apache.mina.util.AvailablePortFinder.getNextAvailable();
}{code}
> The AvailablePortFinder is overly complex
> -----------------------------------------
>
> Key: DIRMINA-839
> URL: https://issues.apache.org/jira/browse/DIRMINA-839
> Project: MINA
> Issue Type: Improvement
> Affects Versions: 2.0.4
> Reporter: Emmanuel Lécharny
> Priority: Major
> Fix For: 2.0.6, 3.0.0-DEAD
>
>
> We have a helper method that returns an availble port, doing a loop. This is
> probably overly complex, when a simple call to :
> new ServerSocket( 0 ).getLocalPort()
> will return the first available port.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]