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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 | 584 |
585 // If |remote_candidate_| is peer reflexive and is equivalent to | 585 // If |remote_candidate_| is peer reflexive and is equivalent to |
586 // |new_candidate| except the type, update |remote_candidate_| to | 586 // |new_candidate| except the type, update |remote_candidate_| to |
587 // |new_candidate|. | 587 // |new_candidate|. |
588 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); | 588 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); |
589 | 589 |
590 // Returns the last received time of any data, stun request, or stun | 590 // Returns the last received time of any data, stun request, or stun |
591 // response in milliseconds | 591 // response in milliseconds |
592 int64_t last_received() const; | 592 int64_t last_received() const; |
593 | 593 |
594 // If the connection need to send Ping at fast rate. | |
pthatcher1
2016/05/27 17:36:31
Ping => pings
at fast rate => at a fast rate
Taylor Brandstetter
2016/05/27 20:11:00
also need => needs
| |
595 bool NeedToPingFast(); | |
pthatcher1
2016/05/27 17:36:31
I'd prefer to simply expose pings_sent() as a meth
Taylor Brandstetter
2016/05/27 20:11:00
I agree with this. P2PTransportChannel can have a
| |
596 | |
594 protected: | 597 protected: |
595 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; | 598 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; |
596 | 599 |
597 // Constructs a new connection to the given remote port. | 600 // Constructs a new connection to the given remote port. |
598 Connection(Port* port, size_t index, const Candidate& candidate); | 601 Connection(Port* port, size_t index, const Candidate& candidate); |
599 | 602 |
600 // Called back when StunRequestManager has a stun packet to send | 603 // Called back when StunRequestManager has a stun packet to send |
601 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); | 604 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); |
602 | 605 |
603 // Callbacks from ConnectionRequest | 606 // Callbacks from ConnectionRequest |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 private: | 652 private: |
650 void MaybeAddPrflxCandidate(ConnectionRequest* request, | 653 void MaybeAddPrflxCandidate(ConnectionRequest* request, |
651 StunMessage* response); | 654 StunMessage* response); |
652 | 655 |
653 bool reported_; | 656 bool reported_; |
654 State state_; | 657 State state_; |
655 // Time duration to switch from receiving to not receiving. | 658 // Time duration to switch from receiving to not receiving. |
656 int receiving_timeout_; | 659 int receiving_timeout_; |
657 int64_t time_created_ms_; | 660 int64_t time_created_ms_; |
658 | 661 |
662 // Number of pings we have sent. | |
663 int ping_sent_count_; | |
664 | |
659 friend class Port; | 665 friend class Port; |
660 friend class ConnectionRequest; | 666 friend class ConnectionRequest; |
661 }; | 667 }; |
662 | 668 |
663 // ProxyConnection defers all the interesting work to the port. | 669 // ProxyConnection defers all the interesting work to the port. |
664 class ProxyConnection : public Connection { | 670 class ProxyConnection : public Connection { |
665 public: | 671 public: |
666 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); | 672 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); |
667 | 673 |
668 int Send(const void* data, | 674 int Send(const void* data, |
669 size_t size, | 675 size_t size, |
670 const rtc::PacketOptions& options) override; | 676 const rtc::PacketOptions& options) override; |
671 int GetError() override { return error_; } | 677 int GetError() override { return error_; } |
672 | 678 |
673 private: | 679 private: |
674 int error_ = 0; | 680 int error_ = 0; |
675 }; | 681 }; |
676 | 682 |
677 } // namespace cricket | 683 } // namespace cricket |
678 | 684 |
679 #endif // WEBRTC_P2P_BASE_PORT_H_ | 685 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |