Added a getPort method that allows for dynamically assigned ports to be used