Merge pull request #2544 from metamx/fixMaxPort

Limit PortFinder to 0xFFFF
This commit is contained in:
Fangjin Yang 2016-02-25 17:12:53 -08:00
commit 53a5f07c14
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ public class PortFinder
private int chooseNext(int start)
{
for (int i = start; i < Integer.MAX_VALUE; i++) {
// up to unsigned short max (65535)
for (int i = start; i <= 0xFFFF; i++) {
if (!usedPorts.contains(i)) {
return i;
}