This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a free port number on localhost. | |
* | |
* Heavily inspired from org.eclipse.jdt.launching.SocketUtil (to avoid a dependency to JDT just because of this). | |
* Slightly improved with close() missing in JDT. And throws exception instead of returning -1. | |
* | |
* @return a free port number on localhost | |
* @throws IllegalStateException if unable to find a free port | |
*/ | |
private static int findFreePort() { |