zeroconf works with IPv6

This commit is contained in:
badaix 2018-02-17 22:23:04 +01:00
parent e9ff66e78b
commit b34f8a6e00
5 changed files with 57 additions and 38 deletions

View file

@ -218,8 +218,10 @@ int main (int argc, char **argv)
{
if (browser.browse("_snapcast._tcp", avahiResult, 5000))
{
host = avahiResult.ip_;
port = avahiResult.port_;
host = avahiResult.ip;
port = avahiResult.port;
if (avahiResult.ip_version == IPVersion::IPv6)
host += "%" + cpt::to_string(avahiResult.iface_idx);
LOG(INFO) << "Found server " << host << ":" << port << "\n";
break;
}