public class Network extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
getFreeServerPort() |
static int |
getFreeServerPort(InetAddress hostAddress) |
static int[] |
getFreeServerPorts(InetAddress hostAddress,
int poolSize) |
static InetAddress |
getLocalHost() |
static int |
getPreferredFreeServerPort(InetAddress hostAddress,
int preferredPort) |
static int |
getPreferredFreeServerPort(int preferredPort) |
static boolean |
localhostIsIPv6() |
static int |
randomEntryOf(int[] ports) |
public static boolean localhostIsIPv6()
throws UnknownHostException
UnknownHostExceptionpublic static InetAddress getLocalHost() throws UnknownHostException
UnknownHostExceptionpublic static int getPreferredFreeServerPort(int preferredPort)
throws IOException
IOExceptionpublic static int getFreeServerPort()
throws IOException
IOExceptionpublic static int getPreferredFreeServerPort(InetAddress hostAddress, int preferredPort) throws IOException
IOExceptionpublic static int getFreeServerPort(InetAddress hostAddress) throws IOException
IOExceptionpublic static int randomEntryOf(int[] ports)
public static int[] getFreeServerPorts(InetAddress hostAddress, int poolSize) throws IOException
IOExceptionCopyright © 2020. All rights reserved.