return -1;
}
+ unique_ptr<addrinfo, decltype(freeaddrinfo) *> ai_cleanup(ai, &freeaddrinfo);
+
for (const addrinfo *cur = ai; cur != nullptr; cur = cur->ai_next) {
// Seemingly, srt_create_socket() isn't universal; once we try to connect,
// it gets locked to either IPv4 or IPv6. So we need to create a new one
continue;
}
fprintf(stderr, "Connected to destination SRT endpoint at %s.\n", print_addrinfo(cur).c_str());
- freeaddrinfo(ai);
return sock;
}
// Out of candidates, so give up.
- freeaddrinfo(ai);
return -1;
}