Click to See Complete Forum and Search --> : Applet + Network Socket


Gritsch
May 12th, 2000, 12:14 PM
Hi,

I have some problems with my program, maybe somebody knows a solution :

I wrote an Client Server Applikation with Sockets. All my Code worked perfect.
Then I take this working code and place it into an applet. But know the client doesnt find the server ? I also get no Exception. The Client programm waits at following line :


client = new Socket(InetAddress.getByName("168.192.192.123"),5000);



You see I try to connect to a Server (it's the same computer) The Server is also running and listening on port 5000.
But nothing happens ? What shall I do ?

Martin

poochi
May 12th, 2000, 12:24 PM
Try like this :



client = new Socket( applet.getCodeBase().getHost() , 5000 );





Poochi..

Gritsch
May 14th, 2000, 09:53 AM
I tried this out, but it doesnt work ?

The statement you mentioned return a "" String. So do I need a Web Server (e.g. Apache ) running on my local machine to test the applet ?

Martin

Gritsch
May 15th, 2000, 01:12 PM
Hi,

I tried this all out and,you have to install a Web Server :)

After I installed a Apache on my Windows, this all works :)

Martin