From 657f116deb7a870a30b81e7b9ea92f3aa684f395 Mon Sep 17 00:00:00 2001
From: Reiner Hauser <Reiner.Hauser@cern.ch>
Date: Thu, 31 Oct 2013 14:21:32 +0000
Subject: [PATCH] publish to multiple IS servers in NameService

---
 src/NameService.cxx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/NameService.cxx b/src/NameService.cxx
index 53cb773..ff5b52f 100644
--- a/src/NameService.cxx
+++ b/src/NameService.cxx
@@ -4,9 +4,9 @@
 
 #include "MsgInfo.h"
 
-#include "is/infoiterator.h"
 #include "is/infostream.h"
 #include "is/infodictionary.h"
+#include "is/serveriterator.h"
 
 namespace daq {
 
@@ -94,7 +94,7 @@ namespace daq {
                                 break;
                             }
                         }
-
+                        
                         if(matches) {
                             info.Addresses.push_back(intf->address_string() + '/' + intf->netmask_string());
                         }
@@ -108,8 +108,11 @@ namespace daq {
 
             ISInfoDictionary d(m_partition);
 
-            // may throw
-            d.checkin(m_is_server + ".MSG_" + name, info);
+            ISServerIterator servers(m_partition, m_is_server + ".*");
+            while(servers++) {
+                // may throw
+                d.checkin(std::string(servers.name()) + ".MSG_" + name, info);
+            }
 
         }
 
-- 
GitLab