convert ports to int for comparison