File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes client-server communication Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "client-server communication " Watch "client-server communication " New topic
Author

client-server communication

nikitha kakani
Greenhorn

Joined: Dec 15, 2007
Posts: 25
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
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
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?


Android appsImageJ pluginsJava web charts
nikitha kakani
Greenhorn

Joined: Dec 15, 2007
Posts: 25
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
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: client-server communication
 
Similar Threads
RMI binding to more than one IP
SocketException
how to ping apache server from client side?
how to download files from a remote server via java code?
Command Line Argument - Mode Flag