# setting multicast SecurityManager in an applet?

Mejdi Eraslan (eraslan@mcrlab.uottawa.ca)
Wed, 21 Oct 1998 00:49:58 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Weasel McSpanger: "JCE - Download ..."
- Previous message: JDCTechTips@sun.com: "JDC Tech Tips Vol. 2 No. 3"

Hello,

I am using MulticastSocket class in jdk1.1.6, but when the applet calls
joinGroup method, checkMulticast method of SecurityManager is called,
which automatically throws a SecurityException.

To get over the problem, I tried to override the checkMulticast method of
the SecurityManager by implementing my own MulticastSecurityManager class
but, I couldnot be able to set it:

System.setSecurityManager(new MulticastSecurityManager())

throws the exception:
# Security Exception: can't create SecurityManager
SecurityManager already set!

(let me mention that I checked if the already installed SecurityManager
throws an exception when checkMulticast(InetAddress) is called, and it
did)

I tried it on Sun's AppletViewer, Netscape, and IBM VisualJ, but none
worked. Is there a way to override the security managers created by the
browsers? Or is it not useful for applets at all (do you use the
setSecurityManager only for applications)?

Has anybody accomplished to enable multicast communication on applets?

Thanks,

Mejdi Eraslan
eraslan@mcrlab.uottawa.ca

- Next message: Weasel McSpanger: "JCE - Download ..."
- Previous message: JDCTechTips@sun.com: "JDC Tech Tips Vol. 2 No. 3"