Class NetworkUtil

java.lang.Object
com.vaadin.flow.internal.NetworkUtil

public class NetworkUtil extends Object
Utility class for network related methods.

For internal use only. May be renamed or removed in a future release.

  • 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