public class NetUtils extends Object
| Constructor and Description |
|---|
NetUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
available(int port,
int MIN_PORT_NUMBER,
int MAX_PORT_NUMBER) |
static ServerSocket |
availableAndReturn(int MIN_PORT_NUMBER,
int MAX_PORT_NUMBER) |
static int |
availableAndReturn(String hostname,
int MIN_PORT_NUMBER,
int MAX_PORT_NUMBER) |
static String |
getHost() |
static List<Integer> |
getPorts(int number,
int MIN_PORT_NUMBER,
int MAX_PORT_NUMBER) |
static ServerSocket |
holdPort(int port) |
static void |
releasePort(ServerSocket ss) |
public static String getHost()
public static ServerSocket holdPort(int port)
public static void releasePort(ServerSocket ss)
public static boolean available(int port,
int MIN_PORT_NUMBER,
int MAX_PORT_NUMBER)
public static int availableAndReturn(String hostname, int MIN_PORT_NUMBER, int MAX_PORT_NUMBER)
public static ServerSocket availableAndReturn(int MIN_PORT_NUMBER, int MAX_PORT_NUMBER)
Copyright © 2020. All rights reserved.