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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // Called when a connection is determined to be no longer useful to us. We | 498 // Called when a connection is determined to be no longer useful to us. We |
499 // still keep it around in case the other side wants to use it. But we can | 499 // still keep it around in case the other side wants to use it. But we can |
500 // safely stop pinging on it and we can allow it to time out if the other | 500 // safely stop pinging on it and we can allow it to time out if the other |
501 // side stops using it as well. | 501 // side stops using it as well. |
502 bool pruned() const { return pruned_; } | 502 bool pruned() const { return pruned_; } |
503 void Prune(); | 503 void Prune(); |
504 | 504 |
505 bool use_candidate_attr() const { return use_candidate_attr_; } | 505 bool use_candidate_attr() const { return use_candidate_attr_; } |
506 void set_use_candidate_attr(bool enable); | 506 void set_use_candidate_attr(bool enable); |
507 | 507 |
| 508 bool nominated() const { return nominated_; } |
| 509 void set_nominated(bool nominated) { nominated_ = nominated; } |
| 510 |
508 void set_remote_ice_mode(IceMode mode) { | 511 void set_remote_ice_mode(IceMode mode) { |
509 remote_ice_mode_ = mode; | 512 remote_ice_mode_ = mode; |
510 } | 513 } |
511 | 514 |
512 // Makes the connection go away. | 515 // Makes the connection go away. |
513 void Destroy(); | 516 void Destroy(); |
514 | 517 |
515 // Checks that the state of this connection is up-to-date. The argument is | 518 // Checks that the state of this connection is up-to-date. The argument is |
516 // the current time, which is compared against various timeouts. | 519 // the current time, which is compared against various timeouts. |
517 void UpdateState(uint32 now); | 520 void UpdateState(uint32 now); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 void OnMessage(rtc::Message *pmsg); | 594 void OnMessage(rtc::Message *pmsg); |
592 | 595 |
593 Port* port_; | 596 Port* port_; |
594 size_t local_candidate_index_; | 597 size_t local_candidate_index_; |
595 Candidate remote_candidate_; | 598 Candidate remote_candidate_; |
596 ReadState read_state_; | 599 ReadState read_state_; |
597 WriteState write_state_; | 600 WriteState write_state_; |
598 bool connected_; | 601 bool connected_; |
599 bool pruned_; | 602 bool pruned_; |
600 // By default |use_candidate_attr_| flag will be true, | 603 // By default |use_candidate_attr_| flag will be true, |
601 // as we will be using agrressive nomination. | 604 // as we will be using aggressive nomination. |
602 // But when peer is ice-lite, this flag "must" be initialized to false and | 605 // But when peer is ice-lite, this flag "must" be initialized to false and |
603 // turn on when connection becomes "best connection". | 606 // turn on when connection becomes "best connection". |
604 bool use_candidate_attr_; | 607 bool use_candidate_attr_; |
| 608 // Whether this connection has been nominated by the controlling side via |
| 609 // the use_candidate attribute. |
| 610 bool nominated_; |
605 IceMode remote_ice_mode_; | 611 IceMode remote_ice_mode_; |
606 StunRequestManager requests_; | 612 StunRequestManager requests_; |
607 uint32 rtt_; | 613 uint32 rtt_; |
608 uint32 last_ping_sent_; // last time we sent a ping to the other side | 614 uint32 last_ping_sent_; // last time we sent a ping to the other side |
609 uint32 last_ping_received_; // last time we received a ping from the other | 615 uint32 last_ping_received_; // last time we received a ping from the other |
610 // side | 616 // side |
611 uint32 last_data_received_; | 617 uint32 last_data_received_; |
612 uint32 last_ping_response_received_; | 618 uint32 last_ping_response_received_; |
613 std::vector<SentPing> pings_since_last_response_; | 619 std::vector<SentPing> pings_since_last_response_; |
614 | 620 |
(...skipping 22 matching lines...) Expand all Loading... |
637 const rtc::PacketOptions& options); | 643 const rtc::PacketOptions& options); |
638 virtual int GetError() { return error_; } | 644 virtual int GetError() { return error_; } |
639 | 645 |
640 private: | 646 private: |
641 int error_; | 647 int error_; |
642 }; | 648 }; |
643 | 649 |
644 } // namespace cricket | 650 } // namespace cricket |
645 | 651 |
646 #endif // WEBRTC_P2P_BASE_PORT_H_ | 652 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |