If port is known, it can be provided to get-function to skip port lookup