OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const rtc::SentPacket& sent_packet); | 142 const rtc::SentPacket& sent_packet); |
143 | 143 |
144 void OnReadyToSend(rtc::AsyncPacketSocket* socket); | 144 void OnReadyToSend(rtc::AsyncPacketSocket* socket); |
145 | 145 |
146 // This method will send STUN binding request if STUN server address is set. | 146 // This method will send STUN binding request if STUN server address is set. |
147 void MaybePrepareStunCandidate(); | 147 void MaybePrepareStunCandidate(); |
148 | 148 |
149 void SendStunBindingRequests(); | 149 void SendStunBindingRequests(); |
150 | 150 |
151 // Helper function which will set |addr|'s IP to the default local address if | 151 // Helper function which will set |addr|'s IP to the default local address if |
152 // |addr| is the "any" address and |emit_local_for_anyaddress_| is true. | 152 // |addr| is the "any" address and |emit_local_for_anyaddress_| is true. When |
153 void MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const; | 153 // returning false, it indicates that the operation has failed and the |
| 154 // address shouldn't be used by any candidate. |
| 155 bool MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const; |
154 | 156 |
155 private: | 157 private: |
156 // A helper class which can be called repeatedly to resolve multiple | 158 // A helper class which can be called repeatedly to resolve multiple |
157 // addresses, as opposed to rtc::AsyncResolverInterface, which can only | 159 // addresses, as opposed to rtc::AsyncResolverInterface, which can only |
158 // resolve one address per instance. | 160 // resolve one address per instance. |
159 class AddressResolver : public sigslot::has_slots<> { | 161 class AddressResolver : public sigslot::has_slots<> { |
160 public: | 162 public: |
161 explicit AddressResolver(rtc::PacketSocketFactory* factory); | 163 explicit AddressResolver(rtc::PacketSocketFactory* factory); |
162 ~AddressResolver(); | 164 ~AddressResolver(); |
163 | 165 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 false) { | 274 false) { |
273 // UDPPort will set these to local udp, updating these to STUN. | 275 // UDPPort will set these to local udp, updating these to STUN. |
274 set_type(STUN_PORT_TYPE); | 276 set_type(STUN_PORT_TYPE); |
275 set_server_addresses(servers); | 277 set_server_addresses(servers); |
276 } | 278 } |
277 }; | 279 }; |
278 | 280 |
279 } // namespace cricket | 281 } // namespace cricket |
280 | 282 |
281 #endif // WEBRTC_P2P_BASE_STUNPORT_H_ | 283 #endif // WEBRTC_P2P_BASE_STUNPORT_H_ |
OLD | NEW |