OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 addresses->push_back(ip); | 75 addresses->push_back(ip); |
76 } | 76 } |
77 } | 77 } |
78 } | 78 } |
79 freeaddrinfo(result); | 79 freeaddrinfo(result); |
80 return 0; | 80 return 0; |
81 #endif // !__native_client__ | 81 #endif // !__native_client__ |
82 } | 82 } |
83 | 83 |
84 // AsyncResolver | 84 // AsyncResolver |
85 AsyncResolver::AsyncResolver() : error_(-1) { | 85 AsyncResolver::AsyncResolver() |
86 } | 86 : SignalThread(false /* use_socket_server */), error_(-1) {} |
87 | 87 |
88 AsyncResolver::~AsyncResolver() = default; | 88 AsyncResolver::~AsyncResolver() = default; |
89 | 89 |
90 void AsyncResolver::Start(const SocketAddress& addr) { | 90 void AsyncResolver::Start(const SocketAddress& addr) { |
91 addr_ = addr; | 91 addr_ = addr; |
92 // SignalThred Start will kickoff the resolve process. | 92 // SignalThred Start will kickoff the resolve process. |
93 SignalThread::Start(); | 93 SignalThread::Start(); |
94 } | 94 } |
95 | 95 |
96 bool AsyncResolver::GetResolvedAddress(int family, SocketAddress* addr) const { | 96 bool AsyncResolver::GetResolvedAddress(int family, SocketAddress* addr) const { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 break; | 189 break; |
190 } | 190 } |
191 } | 191 } |
192 freeifaddrs(ifa); | 192 freeifaddrs(ifa); |
193 return has_ipv6; | 193 return has_ipv6; |
194 #else | 194 #else |
195 return true; | 195 return true; |
196 #endif | 196 #endif |
197 } | 197 } |
198 } // namespace rtc | 198 } // namespace rtc |
OLD | NEW |