Use a uint16_t for ports so that the full port range can be used