Example usage for java.lang SecurityManager checkMulticast

List of usage examples for java.lang SecurityManager checkMulticast

Introduction

In this page you can find the example usage for java.lang SecurityManager checkMulticast.

Prototype

public void checkMulticast(InetAddress maddr) 

Source Link

Document

Throws a SecurityException if the calling thread is not allowed to use (join/leave/send/receive) IP multicast.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {

    InetAddress add = InetAddress.getLocalHost();

    System.setProperty("java.security.policy", "file:/C:/java.policy");
    SecurityManager sm = new Main();
    System.setSecurityManager(sm);

    sm.checkMulticast(add);

    System.out.println("Allowed!");
}