[
https://issues.apache.org/jira/browse/DIRMINA-839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471010#comment-17471010
]
Emmanuel Lécharny commented on DIRMINA-839:
-------------------------------------------
Hi Eduardo, at the end of the day, the best solution is to call
```ServerSocket( 0 ).getLocalPort()```. It will returns a free port (assuming
another process/thread uses the port in the mean time).
> 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]