public class NetworkUtilities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PORT_NUMBER
The maximum port number value available on a Raspberry Pi.
|
static int |
MIN_PORT_NUMBER
A port number must be a positive integer.
|
Modifier and Type | Method and Description |
---|---|
static int |
getAvailablePort()
Searches a port number available to launch a new server,
or -1 if no port is available.
|
static java.util.List<java.lang.String> |
getIpAddresses()
Returns a list containing all ip addresses (IPv4 and IPv6) of current host,
without any link local or loopback addresses.
|
static boolean |
isAValidPortNumber(int portNumber)
Checks if a port number is a valid port number.
|
public static final int MAX_PORT_NUMBER
public static final int MIN_PORT_NUMBER
public static java.util.List<java.lang.String> getIpAddresses()
public static int getAvailablePort()
public static boolean isAValidPortNumber(int portNumber)
portNumber
- the port number to check.