Writes proper port to the console