public class NetworkUtils extends Object
Constructor and Description |
---|
NetworkUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
availablePort()
Get Available TCP Port
|
static int |
getAvailableTcpPort()
Get Available TCP Port using ServerSocket
|
static int |
getAvailableUdpPort()
Get Available UDP Port using DatagramSocket
|
static InetAddress |
getInterfaceAddress(String interfaceName)
Get Interface Address using interface name eg.
|
static boolean |
isListening(String hostname,
int port) |
static boolean |
isListening(String hostname,
int port,
int timeoutMillis) |
public static int availablePort()
public static int getAvailableTcpPort()
public static int getAvailableUdpPort()
public static boolean isListening(String hostname, int port)
public static boolean isListening(String hostname, int port, int timeoutMillis)
public static InetAddress getInterfaceAddress(String interfaceName) throws SocketException
interfaceName
- Network Interface NameSocketException
- Thrown when failing to get interface addressesCopyright © 2023 Apache NiFi Project. All rights reserved.