Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string ClientManager::findHub(const string& ipPort) const {
- Lock l(cs);
- string url;
- for(auto c: clients) {
- auto ipPortPair = static_cast<NmdcHub*>(c)->parseIpPort(ipPort);
- if(c->getIp() == ipPortPair.first) {
- // If exact match is found, return it
- if(c->getPort() == ipPortPair.second)
- return c->getHubUrl();
- // Port is not always correct, so use this as a best guess...
- url = c->getHubUrl();
- }
- }
- return url;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement