Added method to NetworkUtils to find a free port on the local host