Package com.vaadin.flow.internal
Class NetworkUtil
java.lang.Object
com.vaadin.flow.internal.NetworkUtil
Utility class for network related methods.
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns an available tcp port in the system.static boolean
isFreePort
(int port) Checks if the given port is free.
-
Method Details
-
getFreePort
public static int getFreePort()Returns an available tcp port in the system.- Returns:
- a port number which is not busy
-
isFreePort
public static boolean isFreePort(int port) Checks if the given port is free.- Parameters:
port
- the port to check- Returns:
- true if the port is free, false otherwise
-