com.testvagrant.optimus.commons.PortGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optimus-lite Show documentation
Show all versions of optimus-lite Show documentation
Optimus Lite API to manage test devices and create appium driver based on platform
package com.testvagrant.optimus.commons;
import java.io.IOException;
import java.net.ServerSocket;
public class PortGenerator {
public static Integer aRandomOpenPortOnAllLocalInterfaces() {
try (ServerSocket socket = new ServerSocket(0); ) {
return socket.getLocalPort();
} catch (IOException e) {
throw new RuntimeException("no open ports found for bootstrap");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy