File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does the webservers blocks some range of ports for its use?

 
tuty sra
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have read that the server listens on a port and handles the request to a different port when the request arrives. There are methods which get these port values
request.getServerPort()
request.getLocalPort()
and there is also a method request.getRemotePort() which means the browser also open a port for every page opened? I am really confused about this. If a server and browser reserves a set of ports for themselves, what are those range of ports? what are the ports which are safe to be used in our program? what is the total number of ports which are available in a system? I haven't got answers to all these questions in the book. can you guys help me out?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33719
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tutysra likes coffee:
can you guys help me out?

Please check your private messages about an important administrative matter first.
 
tuty sra
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey I made the required changes. thanks for your suggestion.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check your private messages again. Thanks.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a server can listen on one port then respond on another, but that has nothing to do wit hthe methods you are looking at.

An application listens on a port and IP, typically the port is port 80. Often there is something between the initial request and the application server, eg a web server, load balancer or something, and requests eventually get forwarded to the app server.

The app server may not be listening on port 80, therefore the local and remote ports could be different.
 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check this.

http://www.coderanch.com/t/364255/Servlets/java/difference-between-Ports

I hope that will help you
 
tuty sra
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I could get some information from your replies and the links you gave but, still I need some clarifications
1. What is the total amount of ports available on a system
2. Can there be more ports on a system with a load balancer and many machines
3. Does the browser opens a port for each page opened
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1. What is the total amount of ports available on a system

A port is not a physical thing, it is defined by a 16 bit unsigned integer, so 0 to 65535 are possible.

2. Can there be more ports on a system with a load balancer and many machines

No.

3. Does the browser opens a port for each page opened

No.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic