RE: Applet receiving multicast msg ?

Pascal Ledru (pledru@pluto.cs.uah.edu)
Fri, 01 May 1998 20:43:14 -0500

Date: Fri, 01 May 1998 20:43:14 -0500
From: Pascal Ledru <pledru@pluto.cs.uah.edu>
To: Roland.Schemers@Eng
Subject: RE: Applet receiving multicast msg ?

Roland,
Thanks for your answer.

What I was considering is a little bit different from
what you describe.
I want an UNTRUSTED applet to be able to receive a multicast message
from the host the applet is from . (Since I am going to have a group of
Applets and would like to send only one message. Also since I am working
with Applets, I cannot overwrite the security manager)

My point is that checkMulticast is not necessary in joinGroup
but of course need to stay in send (where it will never be able to send
a multicast message) and receive (where it will only be able to receive
a message from the host the applet is from)
In receive, it is possible to detect where the multicast message is coming
from with a call such as dp.getAddress().getHostName()

Note that with multicasting, it is necessary for the RECEIVER to join a group
since under the hood, there is probably a call such as:
setsockopt(sock, IPPROTO_IP. IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)
but the SENDER actually can use a regular datagram with a multicast address.

On the other hand, with BROADCASTING (255.255.255.255), the RECEIVER does not need
to be modified, but the SENDER need to add something like:
setsockopt(sock, SOL_SOCKET, SO_BROADCAST)

So, I didn't try it yet but I think
An applet CAN receive a broadcast message (from a program written in C since Java
does not allow to set up broadcasting I think) using plain datagrams if the msg
come from the host where the applet is from, but it CANNOT receive a multicast
message from the host the applet is from.

This is certainly NOT consistent.

Does it make sense, and is it something you may considerer in a future
release (when?) or is there something obvious I am missing.

Thank you

Pascal Ledru