Yeah, it's a thing too, but with socket you can only reserve a port.
Using a file instead of a 16bit number is better, mainly it doesn't risk to conflict cause of port collision.
I've never heard of IP port exhaustion being a problem in practice, but even if it is, a named FIFO doesn't have that problem.