FrozenHeart
FrozenHeart

Reputation: 20746

Which ports should be used for non-IANA approved applications

Which range of ports is the best for developers of non-IANA approved applications -- 1024+ or 49152+? At first glance it seems that 49152-65535 is better but it's used by OS for ephemeral ports anyway.

Upvotes: 0

Views: 38

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123270

To use a port as a server you need to bind explicitly to this port. But client sockets (i.e. connections originating at this host) also need to have ports and unless they have a port explicitly set they pick one from the range of ephemeral ports.

This means that if you want to use a specific ephemeral port number for a server socket it might be that some client socket is already bound to it. Thus it is better to use a non-ephemeral port for server sockets.

Upvotes: 2

Related Questions