Determine the tcp port to use at runtime.