private void receive() {
        receiver = new Thread() {
            @Override
            public void run() {
                while (true) {
                    try {
                        byte[] data = new byte[1024];
                        DatagramPacket packet = new DatagramPacket(data, data.length);
                        datagramSocket.receive(packet);
                        analyse(packet);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        };
        receiver.start();
    }