Dear Readers, I do not know whether this question should be posted in this section but I feel its a small question. My problem is that how do I know whether a particular port is already in use. And also what is the range of ports available in Windows or other common OS's.
the range is greater than that; a port number is at least a signed 16-bit integer, so they go up to no less than 32767. i could be wrong about that, too - if port numbers turn out to be unsigned (i'm not sure about that detail), then the numbers would go up to 65535 at a minimum.
many modern OS'es, of course, limit the bottom-most 1024 ports such that ordinary users can't open server sockets on them. but this is seldom much of a concern.
[edit: clarification] [ May 04, 2005: Message edited by: M Beck ]
Shyam Prasad Murarka
Joined: May 02, 2005
Dear Readers, So, basically the only way of finding out whether a port is in use is by trying to create a ServerSocket on it and if it throws an exception then it means that the port is in use. Thank you very much guys.