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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // Called when the Connection discovers a local peer reflexive candidate. | 281 // Called when the Connection discovers a local peer reflexive candidate. |
282 // Returns the index of the new local candidate. | 282 // Returns the index of the new local candidate. |
283 size_t AddPrflxCandidate(const Candidate& local); | 283 size_t AddPrflxCandidate(const Candidate& local); |
284 | 284 |
285 void set_candidate_filter(uint32 candidate_filter) { | 285 void set_candidate_filter(uint32 candidate_filter) { |
286 candidate_filter_ = candidate_filter; | 286 candidate_filter_ = candidate_filter; |
287 } | 287 } |
288 | 288 |
289 protected: | 289 protected: |
290 enum { | 290 enum { |
291 MSG_CHECKTIMEOUT = 0, | 291 MSG_DEAD = 0, |
292 MSG_FIRST_AVAILABLE | 292 MSG_FIRST_AVAILABLE |
293 }; | 293 }; |
294 | 294 |
295 void set_type(const std::string& type) { type_ = type; } | 295 void set_type(const std::string& type) { type_ = type; } |
296 | 296 |
297 void AddAddress(const rtc::SocketAddress& address, | 297 void AddAddress(const rtc::SocketAddress& address, |
298 const rtc::SocketAddress& base_address, | 298 const rtc::SocketAddress& base_address, |
299 const rtc::SocketAddress& related_address, | 299 const rtc::SocketAddress& related_address, |
300 const std::string& protocol, | 300 const std::string& protocol, |
301 const std::string& relay_protocol, | 301 const std::string& relay_protocol, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 return rtc::DSCP_NO_CHANGE; | 333 return rtc::DSCP_NO_CHANGE; |
334 } | 334 } |
335 | 335 |
336 uint32 candidate_filter() { return candidate_filter_; } | 336 uint32 candidate_filter() { return candidate_filter_; } |
337 | 337 |
338 private: | 338 private: |
339 void Construct(); | 339 void Construct(); |
340 // Called when one of our connections deletes itself. | 340 // Called when one of our connections deletes itself. |
341 void OnConnectionDestroyed(Connection* conn); | 341 void OnConnectionDestroyed(Connection* conn); |
342 | 342 |
343 // Checks if this port is useless, and hence, should be destroyed. | 343 // Whether this port is dead, and hence, should be destroyed on the controlled |
344 void CheckTimeout(); | 344 // side. |
| 345 bool dead() const { |
| 346 return ice_role_ == ICEROLE_CONTROLLED && connections_.empty(); |
| 347 } |
345 | 348 |
346 rtc::Thread* thread_; | 349 rtc::Thread* thread_; |
347 rtc::PacketSocketFactory* factory_; | 350 rtc::PacketSocketFactory* factory_; |
348 std::string type_; | 351 std::string type_; |
349 bool send_retransmit_count_attribute_; | 352 bool send_retransmit_count_attribute_; |
350 rtc::Network* network_; | 353 rtc::Network* network_; |
351 rtc::IPAddress ip_; | 354 rtc::IPAddress ip_; |
352 uint16 min_port_; | 355 uint16 min_port_; |
353 uint16 max_port_; | 356 uint16 max_port_; |
354 std::string content_name_; | 357 std::string content_name_; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 const rtc::PacketOptions& options); | 635 const rtc::PacketOptions& options); |
633 virtual int GetError() { return error_; } | 636 virtual int GetError() { return error_; } |
634 | 637 |
635 private: | 638 private: |
636 int error_; | 639 int error_; |
637 }; | 640 }; |
638 | 641 |
639 } // namespace cricket | 642 } // namespace cricket |
640 | 643 |
641 #endif // WEBRTC_P2P_BASE_PORT_H_ | 644 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |