Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

client-server communication  RSS feed

 
nikitha kakani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,

LAN: in my lan my servlet is sending response to client & forwarding response .In my lan my server ipaddress is 192.168.5.90

clientaddress=request.getRemoteAddress();
response.sendRedirect("http://"+clinetaddress+":8080/readfile);

but went we webhosted the program is not working its giving a false ipaddress for client.
when webhosted my server ip changed 192.168.5.90 to 53.192.168.99 or so .when i started to see from out side system that is not in lan .The program didnot work ,actually clinet ipaddress is 192.168.6.88 but it gave like 202.44.80.9 can any one tell me what might be the problem thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IP addresses in the range 192.168.* are not "real" addresses. They are internal addresses that only work in that same network. Generally, not all machines on a network can be reached from the outside; only those that have been especially set up. Ask your network admin if the machine you're trying to reach is accessible from the outside. Chances are it's not, and that he's not going to change that either for security reasons.

I don't understand what exactly you're trying to do, though. What does it mean to "send a response and forward a response" - a servlet can only do one of those things. Also, it looks like the web server is redirecting to an URL on the client - that's a rather strange thing to do; can you elaborate what's happening there?
 
nikitha kakani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply,
the problem is ,the servlet(in server side) sends response to client servlet.In the client side it invokes a servlet for its purpose(with separate tomcat).The main problem for me is servlet on server side is not catching client side servlet.when i did this in lan it worked ,but outside systems its not working.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client machine is most likely not set up to be accessible from the outside. As I said above, talk to the network admin about that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!