This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Just got an idea for an Applet to Application program...
So basically, the client is the Applet. The application is the server (1 application running, any number of Applets running). The Application's IP is dynamic. A different Application connects to the Applet to tell it it's IP address. Then, the stream closes. The Applet then connects to the regular Application. Is this possible? If I do this, can I avoid signing it (I know this is an applet question, but I feel it is okay because it deals with sockets and IP)?
EDIT (Clarification) : There will be two applications running...One is for telling the Applet it's IP address (That is the "different Application" part). The other is the main server.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
An applet can only connect to the very same server it's downloaded from, and you can use getCodeBase() or getDocumentBase() to get a URL from which you can receive the server. If you want to connect to anything else you will have to sign the applet.
I'll still move this thread to our Applets forum since it's an applet specific problem.
So I made the Client (Applet, just a simple test) :
Then, I made the Server (Application) :
I made the Applet into a signed JAR. I put it unto a test website ( http://appletclient.webs.com ).
NOTE: The Applet is still on the website. My server may not be up if you go to it...
I started my server. I then went to the website. I accepted the certificate. It successfully sent the data expected to my Server. Then, I had a friend try ( on a different computer, different IP address). He accepted the certificate, but nothing happened on the Server part. Why didn't this work? It is signed and certificated (check it out for yourself). It works fine if I got to the link. How can I make this work?
EDIT: Yes, I do have port forwarding enabled for port 5000. I'm very eager to get this working...
Got it working. Had to add one line to main (the very first line) :
Just a thought (Unrelated) : Why are my post now being ignored? It seems the farther I go in the Java community, the less help I get. I mean, I eventually can solve most of my problems, but I need support guys. Well, anyway, thanks for helping. I really have enjoyed my stay here (I'm not leaving right now).