I have always wondered why automatically assigned ports in BSD sockets range from 1024 to 5000... can anyone tell me why is this?
Printable View
I have always wondered why automatically assigned ports in BSD sockets range from 1024 to 5000... can anyone tell me why is this?
http://www.iana.org/assignments/port-numbers
0 to 1023 are reserved.
Your OS probably treats the range you observe as a pool of ports to use, so it picks the next free one in that range.
This isn't a C question, moved.