Example usage for io.vertx.core.datagram DatagramSocket blockMulticastGroup

List of usage examples for io.vertx.core.datagram DatagramSocket blockMulticastGroup

Introduction

In this page you can find the example usage for io.vertx.core.datagram DatagramSocket blockMulticastGroup.

Prototype

Future<Void> blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock);

Source Link

Document

Like #blockMulticastGroup(String,String,String,Handler) but returns a Future of the asynchronous result

Usage

From source file:examples.DatagramExamples.java

License:Open Source License

public void example7(Vertx vertx) {
    DatagramSocket socket = vertx.createDatagramSocket(new DatagramSocketOptions());

    // Some code//  ww w.  j a v  a  2  s . c o  m

    // This would block packets which are send from 10.0.0.2
    socket.blockMulticastGroup("230.0.0.1", "10.0.0.2", asyncResult -> {
        System.out.println("block succeeded? " + asyncResult.succeeded());
    });
}