if (magic == SOLICIT)
{
Packet out;
- out << RESPONSE << mAddress.service() << mText;
+ out << RESPONSE << mType << mName << mText;
sock.socket().write(out);
return 0;
}
packet >> magic;
if (magic == RESPONSE)
{
- std::string service;
- std::string text;
-
- packet >> service >> text;
- if (service == mService)
+ std::string type;
+ packet >> type;
+ if (type == mType)
{
- mServices.push_back(Service(address, text));
+ std::string name;
+ std::string text;
+ packet >> name >> text;
+ mServices.insert(std::make_pair(name,
+ Service(address, name, text)));
return 0;
}
}
return -1;
}
-ServiceFinder::ServiceFinder(const std::string& service, int type)
+ServiceFinder::ServiceFinder(const std::string& type, int sockType)
{
}