Unix Programming - Ports:1024-65535 or Ports:49152-65535 for socket communication??

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2004 > Ports:1024-65535 or Ports:49152-65535 for socket communication??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Ports:1024-65535 or Ports:49152-65535 for socket communication??
qazmlp

2004-10-27, 5:52 pm

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? Is it mandatory to choose the
ports which are within range:49152-65535 as they are the only ports
available for free use?
Michael Fuhr

2004-10-27, 8:46 pm

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/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com