ehea: New method to determine number of available ports