only check port number when supplied or when starting a server