WriteMulticast

byte[] outbuf = new byte[1024];
int port = 1234;
try {
    DatagramSocket socket = new DatagramSocket();
    InetAddress groupAddr = InetAddress.getByName("228.1.2.3");
    DatagramPacket packet = new DatagramPacket(outbuf, outbuf.length, groupAddr, port);
    socket.send(packet);
} catch (SocketException e) {
} catch (IOException e) {
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.