private int listenMulticast() {
    try {
      bRecv = new byte[65535];
      pack = new DatagramPacket(bRecv, bRecv.length, InetAddress.getByName("255.0.0.5"), 10602);
      elections.setSoTimeout(5000);
      System.out.println(father.getId() + ": Listening to the elections "
              + "multicast socket");

      try {
        elections.receive(pack);
      } catch (IOException ioe) {
        System.out.println(father.getId() + ": No package received");
        return 0;
      }


      /*
       * Received something, analize
       */
      bin = new ByteArrayInputStream(pack.getData());
      ois = new ObjectInputStream(bin);
      msg = (Message) ois.readObject();

      if (msg.getType() == EnumMessageType.COORDINATOR) {
        /*
         * A new coordinator has been elected
         */
        System.out.println(father.getId() + ": Received a COORDINATOR message"
                + " from: " + msg.getId());
        father.setCoordId(msg.getId());
        return 2;
      } else if (msg.getType() == EnumMessageType.ELECTION_S) {
        System.out.println(father.getId() + ": Received an ELECTION_S message "
                + "from " + msg.getId());
        if (msg.getId() <= father.getId()) {
          /*
           * Respond to the process that sent the message and start elections
           */
          respSock = new Socket(father.getDns().get(msg.getId()), 11149);
          pwout = new PrintWriter(respSock.getOutputStream());
          respSock.setSoTimeout(50);
          
          pwout.println("Sending response to election from " + father.getId());
          startElections();
        }
        return 1;
      } else {
        System.out.println("Message received on elections multicast "
                + "that is not of invalid type: " + msg.getType());
        return -1;
      }
    } catch (SocketException se) {
      System.out.println(se.getMessage());
    } catch (IOException ioe) {
      System.out.println(ioe.getMessage());
    } catch (ClassNotFoundException cne) {
      System.out.println(cne.getMessage());
    }
    return 0;
  }