Generalized reading port numbers