public void run() {

            InetAddress group = null;
            MulticastSocket socket = null;
            try {
                socket = new MulticastSocket(port);
                group = InetAddress.getByName(multicast);
            } catch (UnknownHostException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }

            try {
                socket.joinGroup(group);
            } catch (IOException e) {
                e.printStackTrace();
            }


            while(true) {
                try {
                    byte[] buf = new byte[10*1024];
                    packet = new DatagramPacket(buf, buf.length);
                    try {
                        socket.receive(packet);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }

                    String received = new String(packet.getData());
                   System.out.println(packet.getAddress().getHostName() + " sends\n" + received);

                    data = received.trim();

                    Thread.sleep(10);
                } catch (InterruptedException e) { e.printStackTrace();}

            }
        }