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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 candidate_filter_ = candidate_filter; | 297 candidate_filter_ = candidate_filter; |
298 } | 298 } |
299 int16_t network_cost() const { return network_cost_; } | 299 int16_t network_cost() const { return network_cost_; } |
300 | 300 |
301 protected: | 301 protected: |
302 enum { | 302 enum { |
303 MSG_DEAD = 0, | 303 MSG_DEAD = 0, |
304 MSG_FIRST_AVAILABLE | 304 MSG_FIRST_AVAILABLE |
305 }; | 305 }; |
306 | 306 |
| 307 virtual void UpdateNetworkCost(); |
| 308 |
307 void set_type(const std::string& type) { type_ = type; } | 309 void set_type(const std::string& type) { type_ = type; } |
308 | 310 |
309 void AddAddress(const rtc::SocketAddress& address, | 311 void AddAddress(const rtc::SocketAddress& address, |
310 const rtc::SocketAddress& base_address, | 312 const rtc::SocketAddress& base_address, |
311 const rtc::SocketAddress& related_address, | 313 const rtc::SocketAddress& related_address, |
312 const std::string& protocol, | 314 const std::string& protocol, |
313 const std::string& relay_protocol, | 315 const std::string& relay_protocol, |
314 const std::string& tcptype, | 316 const std::string& tcptype, |
315 const std::string& type, | 317 const std::string& type, |
316 uint32_t type_preference, | 318 uint32_t type_preference, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 void OnConnectionDestroyed(Connection* conn); | 357 void OnConnectionDestroyed(Connection* conn); |
356 | 358 |
357 // Whether this port is dead, and hence, should be destroyed on the controlled | 359 // Whether this port is dead, and hence, should be destroyed on the controlled |
358 // side. | 360 // side. |
359 bool dead() const { | 361 bool dead() const { |
360 return ice_role_ == ICEROLE_CONTROLLED && connections_.empty(); | 362 return ice_role_ == ICEROLE_CONTROLLED && connections_.empty(); |
361 } | 363 } |
362 | 364 |
363 void OnNetworkInactive(const rtc::Network* network); | 365 void OnNetworkInactive(const rtc::Network* network); |
364 | 366 |
| 367 void OnNetworkTypeChanged(const rtc::Network* network); |
| 368 |
365 rtc::Thread* thread_; | 369 rtc::Thread* thread_; |
366 rtc::PacketSocketFactory* factory_; | 370 rtc::PacketSocketFactory* factory_; |
367 std::string type_; | 371 std::string type_; |
368 bool send_retransmit_count_attribute_; | 372 bool send_retransmit_count_attribute_; |
369 rtc::Network* network_; | 373 rtc::Network* network_; |
370 rtc::IPAddress ip_; | 374 rtc::IPAddress ip_; |
371 uint16_t min_port_; | 375 uint16_t min_port_; |
372 uint16_t max_port_; | 376 uint16_t max_port_; |
373 std::string content_name_; | 377 std::string content_name_; |
374 int component_; | 378 int component_; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 const rtc::PacketOptions& options) override; | 674 const rtc::PacketOptions& options) override; |
671 int GetError() override { return error_; } | 675 int GetError() override { return error_; } |
672 | 676 |
673 private: | 677 private: |
674 int error_ = 0; | 678 int error_ = 0; |
675 }; | 679 }; |
676 | 680 |
677 } // namespace cricket | 681 } // namespace cricket |
678 | 682 |
679 #endif // WEBRTC_P2P_BASE_PORT_H_ | 683 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |