Advertisement

Using a Java Applet as a client program

Started by August 28, 2003 06:51 PM
3 comments, last by Arek the Absolute 21 years, 5 months ago
I''ve been working more on the MUD project, and I''ve gotten to the point whre it''s more convenient to write my own client program for people to connect with. (Yes, I want to write my own client even if it''s unneccessary. The whole point of this project is just to learn. ) So I''ve decided I want to try to make my client a Java applet that I can upload onto my comcast webspace and allow people to connect through that. The problem is that neither this computer or any other can seem to connect with the server program once it''s been uploaded. If I have the applet connect to the IP designated by my router and run the applet on my harddrive, it will connect properly. If I upload it, no matter what IP I use, no one can connect. Now, the part that confuses me is that people outside of my network can still connect to the server through telnet, but for some reason the Java applet can''t. When connecting, they always get an error that reads "applet error java.security.AccessControlException: access denied (java.net.SocketPermission 24.61.108.46:23 connect,resolve)" (the same error whether the server''s actually running or not) Is it possible that Comcast is somehow denying access for the connection, or is there something I''m missing as far as having the Java applet connect? Can anyone explain to me what might be causing this? Sorry if this is more at home in the Java forum, but it seemed to me that seeing as this problem is based on internet connections, it was better suited here. -Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Applet have a special security policy: you *can not* do anything on client once they have downloaded your applet.

One solution to allow this is to build a jar file that will contain all your classes and then to sign your jar file, search on the java web site for informations...

WS
Advertisement
Cripes! You'd have figured the site I jacked most of the code for my client applet from would have mentioned something like that.

That'll teach me to trust a site called Webmonkey, huh?

At least I don't have to feel like I wasted a lot of my own time on it, huh? I was going to make the applet my own (and have a lot more useful MUD client type features) but if that's the case, I'm glad I caught this here. Thanks!

-Arek the Absolute

[edited by - Arek the Absolute on August 29, 2003 8:56:08 PM]
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
I don''t bout the errors you''re getting, but it actually IS possible
to what you intend with an applet. Just check out "Bub''s Bros", a networked Bubble Bobble clone at http://bub-n-bros.sourceforge.net/

The game features a Python server + client as well as a Java applet
client. The trick might be though that the server also acts as a HTTP server that delivers the applet.

cheers,
Christian.
There's a JavaMUD out there called, IIRC, WolfMUD. It has an Applet client. Source is available also. You should be able to Google it.

And I forgot to mention that the problem your having does relate to the Applet security, as mentioned above, but it'[s not that you can't do *anything*. To connect to a server via an applet the server must be on the same host that delivered the applet. That's why it connected fine for you locally but crapped out when you put the Applet on your webserver.

[edited by - Aldacron on September 1, 2003 10:56:36 PM]

This topic is closed to new replies.

Advertisement