Ensure minimum port range
This commit is contained in:
parent
8857d1d016
commit
f891e76478
|
@ -27,7 +27,7 @@ class PortAllocator(basePort: Int, numberOfPortsToAllocate: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
minPort = basePort
|
minPort = basePort
|
||||||
maxPort = basePort + (numberOfPortsToAllocate - 1)
|
maxPort = Math.max(basePort+1, basePort + (numberOfPortsToAllocate - 1))
|
||||||
|
|
||||||
if (maxPort !in (basePort + 1)..65535) {
|
if (maxPort !in (basePort + 1)..65535) {
|
||||||
throw IllegalArgumentException("Uppermost port $maxPort must be in the range [$basePort, 65535]")
|
throw IllegalArgumentException("Uppermost port $maxPort must be in the range [$basePort, 65535]")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user