Validate port parameter.