source and destination ports can and do go above 32768 on many OSes.
As such short is the wrong type for them, and have switched to long.