private static boolean isPortInUse()

in 2-advanced/dubbo-samples-async/dubbo-samples-async-simple-boot/dubbo-samples-async-simple-boot-provider/src/main/java/org/apache/dubbo/async/boot/provider/EmbeddedZooKeeper.java [299:306]


    private static boolean isPortInUse(int port) {
        try (ServerSocket ignored = new ServerSocket(port)) {
            return false;
        } catch (IOException e) {
            // continue
        }
        return true;
    }