public interface PortSupplier
Modifier and Type | Method and Description |
---|---|
int |
obtainPort(PortRange range)
Reserve a port for your application, with a port number in a specific range.
|
boolean |
obtainSpecificPort(int portNumber)
Reserve a specific port for an application.
|
void |
releasePort(int portNumber)
Release a previously reserved port.
|
boolean obtainSpecificPort(int portNumber)
portNumber
- the required port number.true
if the port was successfully reserved; false
if it has been previously reserved.int obtainPort(PortRange range)
range
- the range of acceptable port numbers.void releasePort(int portNumber)
portNumber
- the port number from a call to obtainPort(PortRange)
or obtainSpecificPort(int)