Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Valid Port Range

 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with 64k to work with the valid port range is (1024 x 64) so thats 0 through 65535, problem is the server can listen on port 0 for example, but the client cannot connect, or similar possible problems, my feeling on this is that we should allow all between that range, even well known reserved ports, but it should be the users reposibility to ensure that on their operating system the port configured can be used, is this correct?
 
Damian Ryan
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I did. Just make sure you document your assumptions.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Damian Ryan:
This is what I did. Just make sure you document your assumptions.

agreed, done it is then, thank you
 
SrinivasMA Srini
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If the port number is out of range catch the exception also. It is advisable to catch the following exception:
catch( IllegalArgumentException illegalArgumentException )
{
System.out.println( " Port number is out of range. It is recommended to use valid port number.");
System.exit( 0 );
}
Cheers
Srinivas
SCJP,SCJD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic