Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.net.InetAddress;
import java.net.MulticastSocket;

public class Main {
    public static void main(String[] argv) throws Exception {

        String groupName = "groupName";
        int port = 1024;
        MulticastSocket msocket = new MulticastSocket(port);
        InetAddress group = InetAddress.getByName(groupName);
        msocket.joinGroup(group);

    }
}