As noticed during review of the I2P network support, CService::port is uint16_t but is passed around the codebase and into the ctors as int, which causes uneeded conversions and casts. We can avoid these (including in the incoming I2P code without further changes to it) by using ports with the correct type. The remaining conversions are pushed out to the user input boundaries where they can be range-checked and raise with user feedback in the next patch.
This is a backport of core#21328 [1/3]
https://github.com/bitcoin/bitcoin/pull/21328/commits/6423c8175fad3163c10ffdb49e0df48e4e4931f1