This is a question out of curiosity:
I am using a database system (kdb+), and the documentation of this system seems to be coherent in choosing to open a socket to either port 5000 or port 5001 for communication purposes.
In another part of the documentation I found a statement saying that their automatic multiprocessing command opens ports from 20000 through 20000+N-1.
I am curious to know if there is any heuristic for opening a specific port:
- Is there a common practice for this?
- Does it matter at all (for choosing ports above port 1024)?
- How do you choose your ports?
The way I see it, port 2000 seems like a safe bet to make sure no other applications are using that port. But then why do code examples in other parts of the documentation seem to prefer 5000 and 5001 that much? (Wikipedia didn't help in explaining this to me)