Пример #1
0
 Contact queryName(const ConstString& name) {
     activate();
     for (int i=0; i<(int)spaces.size(); i++) {
         NameSpace *ns = spaces[i];
         if (!ns) continue;
         if (ns->getNameServerName()==name) {
             return ns->getNameServerContact();
         }
         Contact result = ns->queryName(name);
         if (result.isValid()) return result;
     }
     return Contact();
 }
Пример #2
0
 Contact queryName(const char *name) {
     activate();
     for (int i=0; i<(int)spaces.size(); i++) {
         NameSpace *ns = spaces[i];
         if (!ns) continue;
         if (ns->getNameServerName()==name) {
             return ns->getNameServerContact();
         }
         //printf("Query from %s\n", spaces[i]->getNameServerName().c_str());
         Contact result = ns->queryName(name);
         //printf("Got %s\n", result.toString().c_str());
         if (result.isValid()) return result;
     }
     return Contact();
 }
Пример #3
0
 Contact queryName(const ConstString& name) {
     activate();
     // try query against each namespace in order
     for (int i=0; i<(int)spaces.size(); i++) {
         NameSpace *ns = spaces[i];
         if (!ns) continue;
         if (ns->getNameServerName()==name) {
             // optimization: return cached server address for 
             // port names that match name of namespace
             return ns->getNameServerContact();
         }
         Contact result = ns->queryName(name);
         // return a result once we get one, skipping any remaining
         // namespaces
         if (result.isValid()) return result;
     }
     return Contact();
 }