Re: is using applet-servlet communication to implement realtime features possible?



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

"Arne Vajhøj" <arne@xxxxxxxxxx> wrote in message
news:46902295$0$90262$14726298@xxxxxxxxxxxxxxxxxx
Richard Maher wrote:
Hi Arne,

The problem is not the applet but the servlet.

Whether #2 and #3 uses TCP or UDP does not matter.

It was the "connect" or "Connection" bit that threw me.

Yes - that sound a bit TCP'ish.

Look, I've never
done this so it may not be this simple, but I imagine your "stand alone"
server (and only one instance of) could send multicast messages out over
the
network and if the Applet has subscribed to such messages then it's
receive() (probably in a seperate thread) will update it's part of the
page
with the latest price info.

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.

And



.



Relevant Pages

  • Re: UDP applet
    ... thanks you seemed to have prooved that a regular applet can receive ... udp datagram from its server though all that remains mysterious and my ... -my c# echo udp works fine with a standalone java app from my local ...
    (comp.lang.java.programmer)
  • Re: UDP applet
    ... udp datagram from its server though all that remains mysterious and my ... your udp applet http://www.knutejohnson.com/echo.html works fine ... -my c# echo udp works fine with a standalone java app from my local ...
    (comp.lang.java.programmer)
  • Re: Howto find multiple servers using TCP
    ... But you can still use asynchronous sockets for UDP. ... Obviously, this only works when you have a possible multicast router, or no router at all; ... When a packet is sent using a UDP socket ... But if the server program is your program, ...
    (microsoft.public.vc.mfc)
  • TTL Question. Dont understand the boundaries.
    ... I am just venturing into UPD sockets, and Multicast. ... specific port for UDP messages asking it its location. ... application broadcast a message and once the server receives the message it ... sends a reply directly to the client that asked the question. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Unicast works, but Multicast will not
    ... I only disabled UDP traffic on the client side, but when I enable UDP on the ... the server and I do not see any settings for enabling UDP. ... When I check the multicast group memberships on the Cisco 3550 router, ...
    (microsoft.public.windowsmedia.server)