devxlogo

August 29, 2019

How to Check Whether a Port is Free

We can check if a given port is free by trying to construct a ServerSocket with the port that needs to be checked: import java.io.*;import java.net.*;public class CheckingIfPortIsFree{ public static