How to check if a port is open in Java
Here is a minimalist Java code which can be used to test if a port is available. In this example, we are checking for port 8080 by opening a new Socket to that port. We allow up to 10 retries if the port has been found already used. Enjoy it! import java.io.IOException; import java.net.Socket; public … Read more