| Michael Fuhr 2004-10-28, 3:56 am |
| qazmlp1209@rediffmail.com (qazmlp) writes:
> One of the application running on a Unix machine uses the
> ports:30000-30050 for socket communication(during bind() call).
> Is the selection of the ports fine?
What criteria distinguish "fine" from "not fine"?
> Is it mandatory to choose the ports which are within range:49152-65535
> as they are the only ports available for free use?
What is "free use," and who says ports 49152-65535 are the only
ports available? Perhaps you're referring to the range(s) reserved
for ephemeral ports, which varies from system to system.
A process can bind to any port it wants as long as another process
isn't already using it, and providing the process has the appropriate
privileges. It's a good idea to pick ports that no other application
on the system might use so you don't have conflicts. You might
also want to avoid ports in the ephemeral range so you don't
effectively shrink that range, but if the range is large or the
system isn't busy then that shouldn't be a problem.
Is this homework, or do you have a real problem you're trying to
solve?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
|