• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Valid Port Range  RSS feed

 
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?
 
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
 
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
Boost this thread!