@Override
    public void run() {

        for (int i = 1; i <= MAX_TRIES; i++) {
            if (window.RemotePlayer != null && window.RemotePlayer.startsWith("MASTER")) break;
            try {
                // construct quote
                String dString = Pong.address.toString();
                byte[] buf = dString.getBytes();
                // send it
                InetAddress group = InetAddress.getByName("230.0.0.1");
                DatagramPacket packet = new DatagramPacket(buf, buf.length, group, 4446);
                socket.send(packet);
                window.RemotePlayer = String.valueOf(i);
                // sleep for a while
                try {
                    sleep((long) (Math.random() * FIVE_SECONDS));
                } catch (InterruptedException e) {
                }

            } catch (IOException e) {
                window.RemotePlayer = "ERROR: " + e.getMessage();
            }
        }
        window.RemotePlayer = "Tiempo de espera agotado\nNo hay respuesta";
        socket.close();
    }