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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
578 | 578 |
579 // If |remote_candidate_| is peer reflexive and is equivalent to | 579 // If |remote_candidate_| is peer reflexive and is equivalent to |
580 // |new_candidate| except the type, update |remote_candidate_| to | 580 // |new_candidate| except the type, update |remote_candidate_| to |
581 // |new_candidate|. | 581 // |new_candidate|. |
582 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); | 582 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); |
583 | 583 |
584 // Returns the last received time of any data, stun request, or stun | 584 // Returns the last received time of any data, stun request, or stun |
585 // response in milliseconds | 585 // response in milliseconds |
586 int64_t last_received() const; | 586 int64_t last_received() const; |
587 | 587 |
588 std::vector<SentPing> pings_since_last_response() const { | |
589 return pings_since_last_response_; | |
590 } | |
pthatcher1
2016/06/14 00:44:28
We don't need this if we do the thing below.
| |
591 | |
588 protected: | 592 protected: |
589 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; | 593 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; |
590 | 594 |
591 // Constructs a new connection to the given remote port. | 595 // Constructs a new connection to the given remote port. |
592 Connection(Port* port, size_t index, const Candidate& candidate); | 596 Connection(Port* port, size_t index, const Candidate& candidate); |
593 | 597 |
594 // Called back when StunRequestManager has a stun packet to send | 598 // Called back when StunRequestManager has a stun packet to send |
595 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); | 599 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); |
596 | 600 |
597 // Callbacks from ConnectionRequest | 601 // Callbacks from ConnectionRequest |
(...skipping 22 matching lines...) Expand all Loading... | |
620 // By default |use_candidate_attr_| flag will be true, | 624 // By default |use_candidate_attr_| flag will be true, |
621 // as we will be using aggressive nomination. | 625 // as we will be using aggressive nomination. |
622 // But when peer is ice-lite, this flag "must" be initialized to false and | 626 // But when peer is ice-lite, this flag "must" be initialized to false and |
623 // turn on when connection becomes "best connection". | 627 // turn on when connection becomes "best connection". |
624 bool use_candidate_attr_; | 628 bool use_candidate_attr_; |
625 // Whether this connection has been nominated by the controlling side via | 629 // Whether this connection has been nominated by the controlling side via |
626 // the use_candidate attribute. | 630 // the use_candidate attribute. |
627 bool nominated_; | 631 bool nominated_; |
628 IceMode remote_ice_mode_; | 632 IceMode remote_ice_mode_; |
629 StunRequestManager requests_; | 633 StunRequestManager requests_; |
630 int rtt_; | 634 int rtt_; |
pthatcher1
2016/06/14 00:44:28
Can we also store this?
int rtt_samples_ = 0;
An
| |
631 int64_t last_ping_sent_; // last time we sent a ping to the other side | 635 int64_t last_ping_sent_; // last time we sent a ping to the other side |
pthatcher1
2016/06/14 00:44:28
And could we also calculate this?
bool stable() {
| |
632 int64_t last_ping_received_; // last time we received a ping from the other | 636 int64_t last_ping_received_; // last time we received a ping from the other |
633 // side | 637 // side |
634 int64_t last_data_received_; | 638 int64_t last_data_received_; |
635 int64_t last_ping_response_received_; | 639 int64_t last_ping_response_received_; |
636 std::vector<SentPing> pings_since_last_response_; | 640 std::vector<SentPing> pings_since_last_response_; |
637 | 641 |
638 rtc::RateTracker recv_rate_tracker_; | 642 rtc::RateTracker recv_rate_tracker_; |
639 rtc::RateTracker send_rate_tracker_; | 643 rtc::RateTracker send_rate_tracker_; |
640 | 644 |
641 ConnectionInfo stats_; | 645 ConnectionInfo stats_; |
(...skipping 23 matching lines...) Expand all Loading... | |
665 const rtc::PacketOptions& options) override; | 669 const rtc::PacketOptions& options) override; |
666 int GetError() override { return error_; } | 670 int GetError() override { return error_; } |
667 | 671 |
668 private: | 672 private: |
669 int error_ = 0; | 673 int error_ = 0; |
670 }; | 674 }; |
671 | 675 |
672 } // namespace cricket | 676 } // namespace cricket |
673 | 677 |
674 #endif // WEBRTC_P2P_BASE_PORT_H_ | 678 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |