Enable mDNS on Darwin
am: 304150a521
Change-Id: Id0d77614fc3bf580c2879b9ad801c77dcbfc7752
This commit is contained in:
commit
bd2c93fab0
2 changed files with 9 additions and 2 deletions
|
|
@ -150,7 +150,7 @@ LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES)
|
||||||
LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES)
|
LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES)
|
||||||
|
|
||||||
LOCAL_SRC_FILES_linux += transport_mdns.cpp
|
LOCAL_SRC_FILES_linux += transport_mdns.cpp
|
||||||
LOCAL_SRC_FILES_darwin += transport_mdns_unsupported.cpp
|
LOCAL_SRC_FILES_darwin += transport_mdns.cpp
|
||||||
LOCAL_SRC_FILES_windows += transport_mdns_unsupported.cpp
|
LOCAL_SRC_FILES_windows += transport_mdns_unsupported.cpp
|
||||||
|
|
||||||
LOCAL_SANITIZE := $(adb_host_sanitize)
|
LOCAL_SANITIZE := $(adb_host_sanitize)
|
||||||
|
|
|
||||||
|
|
@ -85,10 +85,17 @@ class ResolvedService : public AsyncServiceRef {
|
||||||
const char* hosttarget, uint16_t port) :
|
const char* hosttarget, uint16_t port) :
|
||||||
name_(name),
|
name_(name),
|
||||||
port_(port) {
|
port_(port) {
|
||||||
|
|
||||||
|
/* TODO: We should be able to get IPv6 support by adding
|
||||||
|
* kDNSServiceProtocol_IPv6 to the flags below. However, when we do
|
||||||
|
* this, we get served link-local addresses that are usually useless to
|
||||||
|
* connect to. What's more, we seem to /only/ get those and nothing else.
|
||||||
|
* If we want IPv6 in the future we'll have to figure out why.
|
||||||
|
*/
|
||||||
DNSServiceErrorType ret =
|
DNSServiceErrorType ret =
|
||||||
DNSServiceGetAddrInfo(
|
DNSServiceGetAddrInfo(
|
||||||
&sdRef_, 0, interfaceIndex,
|
&sdRef_, 0, interfaceIndex,
|
||||||
kDNSServiceProtocol_IPv6|kDNSServiceProtocol_IPv4, hosttarget,
|
kDNSServiceProtocol_IPv4, hosttarget,
|
||||||
register_service_ip, reinterpret_cast<void*>(this));
|
register_service_ip, reinterpret_cast<void*>(this));
|
||||||
|
|
||||||
if (ret != kDNSServiceErr_NoError) {
|
if (ret != kDNSServiceErr_NoError) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue