Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getServerPort() vs getLocalPort()

 
Rajan Chinna
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which context these two methods are used on request object? Whats the difference?
Thanks
 
ming wu
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getServerPost() says, "to which port was the request originally sent?"
getLocalPost() says, "on which port did the request end up with?"

all request are send to a single port(server port), where the server is listening. then the server find another port(Local port) to handle this thread, so that the app server can handle many client at the sametime.
 
Rajan Chinna
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means this is useful when we configure Apache & Tomcat together.

Lets say I configure Apache at port 80 and Tomcat at port 8080, can i say getServerPost() refers to port 80 and getLocalPost() refers to 8080 port.

Am I right in understanding this?

Lets say I use only Tomcat at port 80 in this case I cannot use getLocalPost() rite?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic