public void matchSubscriptions(Message message) {

        try {
            List<Subscription> subscriptions = this.parent.getSubscriptionByTopic(message.getTopic());
            for (Subscription subscription : subscriptions) {
                try {
                    System.out.println("Enviando mensaje a: " + subscription.getIpAddress());
                    Socket newSocket;
                    newSocket = new Socket(subscription.getIpAddress(), subscription.getPort());
                    ObjectOutputStream dos = new ObjectOutputStream(newSocket.getOutputStream());
                    dos.writeObject(message);
                    newSocket.close();
                } catch (IOException ex) {
                    System.out.println("Failed to deliver message:" + ex);
                }
            }
        } catch (Exception ex) {
            System.out.println("machSubscriptions:" + ex);
        }
    }