pblm in establishing communication bt applet and its server over internet

P

prabhu

HI ,
I am Prabhakaran. I am having pblm in establishing communication
bt applet and its server over internet. I am using socket programming
for client server communication. I am using apache tomcat 4.0 for
serving those applet classes. I am running Java server program in the
same machine. Whenever i am testing applet /server communication in LAN
it is working fine But in the internet ,the connection is not
established bt applet and server.


Friends,plz reply me soon. I am giving a public IP to my
Server host & also I am opening all ports in server. Applet is
downloaded in clinet host whenever the page is requested but connection
is not established....


Plz help me ..Reply soon

Ur's friendly,
Prbhu...
 
R

Roedy Green

Whenever i am testing applet /server communication in LAN
it is working fine But in the internet ,the connection is not
established bt applet and server.

The usual problem is the security sandbox is getting in the way. It
thinks you are trying to talk to a server other than the one you were
loaded from. To start, are you sure they are the same IP?
 
P

prabhu

HI Roedy,
Thanks for reply. Ya server to which applet has to talk and the
server from where it is loaded are the same host(IP) .

Then what may be the problem.
 
P

prabhu

Hi,
I am getting "No host to route" exceception in the client
side.
I did a simple socket program

Client side
Socket client=new Socket("IP",9999);

Server side

ServerSocket ss=new ServerSocket(9999);
Socket s=ss.accept();
System.out.println("Connection Accepted");

This is my coding . I am not getting "Connection accepted " in the
server side. But all applet files are downloaded in the client browser.


I am catching the exception in the client side and
displaying it in one text box. It is displaying as
"java.net.NoRouteToHostException: No route to host: connect."
 
R

Roedy Green

Socket client=new Socket("IP",9999);

Server side

ServerSocket ss=new ServerSocket(9999);

check your firewalls on both ends that they will let though that
socket.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top