"Filip Larsen" <> wrote in message news:<cl87ma$adu$>...
> S J Rulison wrote
>
> > Can somebody please give me a clue as to what I'm doing wrong here? I
> > have a JAVA Applet and Server application written in JAVA version
> > 1.4.2_05 running on a Windows XP platform. I use the socket(String
> > host, int port) class on the applet side to establish a connection
> > with the Server and the ServerSocket(int port) class on the server
> > side. When I run both the Server and Applet on the same workstation,
> > everything works fine but if I move the Server portion onto another
> > machine, I am unable to establish a connection with that Server.
>
> You do not write what exception you get, but a guess would be that your
> experience the security manager denying your applet to connect to any
> other host than the host from where the applet came. If that is the
> case, try use Applet.getCodeBase() in the applet to check that the host
> really is the one you think. In fact, you can use the code base URL
> directly to ensure you always connect to the originating host by using
> getCodeBase().getHost() as the hostname when you create your sockets.
>
>
> Regards,
Actually, I didn't get any exceptions. And I guess I should have
mentioned that in my original post. Thnak you for the headsup on the
getCodeBase() & getHost() methods. I will look into that and see if
that fixes the problem.
Thanks again.
Sincerely,
Steve Rulison.
|