Hi Arne,
Now you bring it up. I wonder how default applet security have
it UDP.
http://www.cs.utk.edu/~lchen/software/java/udping/
and other googlable links indicates that it is possible.
Short of just trying it, I couldn't find anything on the net (including
SUN's docs) that explicitly stated whether an Applet could receive broadcast
UDP messages and, if so, from whom. (I'm guessing that as long as the
datagrams are going to/from the codebase then no applet-signing is reqd)
Which brings me to the MulticastSocket class and some O'Reily book that says
Multicast methods are a huge security risk and forbidden for
unsigned-Applets. Does anyone know when and why the
SecurityManager.checkMulticast() code would throw an exception for an Applet
that just wants to receive datagrams that have the originating source
details that can be later checked against the codebase?
Anyway, if the OP is still there this is what I'd suggest: -
1) Combo of a) Connection-oriented, context rich TCP/IP socket and b)
Multicast socket
2) Connect to the Application Server and pass authorization via a)
3) Join/subscribe to the Stockwatch multicast group via b)
4) Stand-alone server process picking triggered database changes and
broadcasting to the group
5) For each client seperate thread reading b) and outputing results
6) If a client recieves a message which has a sequence number that is older
than the last one read then ignore it
7) If there is a gap between the previous message sequence received and the
new on than use a) to re-calibrate
8) Server sends heart-beat messages every "n" seconds with next sequence
number
9) If client hasn't received a message after "n" seconds then use a) to
check
Again, I'm guessing that this is what all the "chat" software does? Or those
Wimbledon score update windows?
If you're stuck with Datagram Sockets then the server must keep track of
subscribers and it's all a bit messy.
I looked around for a MulticastSocket Applet example and couldn't find one;
maybe you'll have better luck?
Cheers Richard Maher