Hi evanstaul,
Unfortunately, implementing direct peer-to-peer communication
between applets is very troublesome. But there is another solution
that may work for you (see below).
As you may know, applets run in a sandbox within the browser. The
sandbox limits the access of the applet to system resources,
including sockets. By default, applets are only allowed to open
sockets to the server from which they were originally requested. To
implement direct peer-to-peer communication between applets you'll
have to sign your applet and have the user grant permission to the
applet to open sockets to any host.
Here's an excellent site with step-by-step instructions on how to
write and deploy a signed applet.
http://download.baltimore.com/keytools/docs/v51/pro/j-docs/html/SampleCodes/sampleApplet/codesign/sa/sa_step0.html
The example applet in this case requests permission to write to disk,
but in your case you'd be asking for permission to open a socket.
As you'll see from this site, the steps involved are quite onerous.
Another solution that you might consider is to implement
applet-to-applet
communiction via the server. Each applet opens a socket to a server
application running on the machine from which it was served (which
means
that no certificates or signing are required). One applet can then
commincate
with another by sending a request to the server, which authenticates
it and
passes it on to the destination applet. The drawbacks of this approach
are
that you'll need to write and host a server application and
communication may be a little slower.
Hope this helps.
Eadfrith |