Code example for MulticastSocket

Methods: joinGroup

0
     */ 
    public NetworkListener() { 
        try { 
            this.multiCastAddress = InetAddress.getByName("230.0.0.1");
             
            this.mcSocket = new MulticastSocket(4444);
            this.mcSocket.joinGroup(this.multiCastAddress);
        } catch (IOException e) {
            e.printStackTrace();
        } 
    } 
     
    /** 
     * Constantly running and listening to the networkmessages. 
     */ 
    @Override 
    public void run() { 
        DatagramPacket packet;
         
        while(true) { 
            byte[] buffer = new byte[1024];