diff --git a/src/NameService.cxx b/src/NameService.cxx index a1c1b3e49d601295ba54a4c21edb72dc2f48b00e..d464fc8e67c82e2e0059d467e4d29b0c9baed015 100644 --- a/src/NameService.cxx +++ b/src/NameService.cxx @@ -352,7 +352,11 @@ namespace daq { std::string NameService::allocate_multicast_address(const std::string& addr, const std::string& network) { MultiCastGroup group; - ISInfoDictionary dict(m_partition); + + + group.Partition = m_partition.name(); + group.MulticastAddress = addr; + group.MulticastNetwork = network; if(addr == "*") { @@ -379,6 +383,8 @@ namespace daq { group.MulticastAddress = std::string("224.100.100.") + boost::lexical_cast<std::string>(index); group.MulticastNetwork = network; + ISInfoDictionary dict(IPCPartition("initial")); + while(!found && index < 256) { try { @@ -387,6 +393,7 @@ namespace daq { } catch(...) { // try next index++; + group.MulticastAddress = std::string("224.100.100.") + boost::lexical_cast<std::string>(index); } } } @@ -397,6 +404,7 @@ namespace daq { } } + ISInfoDictionary dict(m_partition); ISServerIterator servers(m_partition, m_is_server + ".*"); if(servers.entries() == 0) { throw InvalidISServer(ERS_HERE,m_is_server);