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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // the current time, which is compared against various timeouts. | 546 // the current time, which is compared against various timeouts. |
547 void UpdateState(int64_t now); | 547 void UpdateState(int64_t now); |
548 | 548 |
549 // Called when this connection should try checking writability again. | 549 // Called when this connection should try checking writability again. |
550 int64_t last_ping_sent() const { return last_ping_sent_; } | 550 int64_t last_ping_sent() const { return last_ping_sent_; } |
551 void Ping(int64_t now); | 551 void Ping(int64_t now); |
552 void ReceivedPingResponse(int rtt, const std::string& request_id); | 552 void ReceivedPingResponse(int rtt, const std::string& request_id); |
553 int64_t last_ping_response_received() const { | 553 int64_t last_ping_response_received() const { |
554 return last_ping_response_received_; | 554 return last_ping_response_received_; |
555 } | 555 } |
| 556 // Used to check if any STUN ping response has been received. |
| 557 int rtt_samples() const { return rtt_samples_; } |
556 | 558 |
557 // Called whenever a valid ping is received on this connection. This is | 559 // Called whenever a valid ping is received on this connection. This is |
558 // public because the connection intercepts the first ping for us. | 560 // public because the connection intercepts the first ping for us. |
559 int64_t last_ping_received() const { return last_ping_received_; } | 561 int64_t last_ping_received() const { return last_ping_received_; } |
560 void ReceivedPing(); | 562 void ReceivedPing(); |
561 // Handles the binding request; sends a response if this is a valid request. | 563 // Handles the binding request; sends a response if this is a valid request. |
562 void HandleBindingRequest(IceMessage* msg); | 564 void HandleBindingRequest(IceMessage* msg); |
563 | 565 |
564 int64_t last_data_received() const { return last_data_received_; } | 566 int64_t last_data_received() const { return last_data_received_; } |
565 | 567 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 const rtc::PacketOptions& options) override; | 716 const rtc::PacketOptions& options) override; |
715 int GetError() override { return error_; } | 717 int GetError() override { return error_; } |
716 | 718 |
717 private: | 719 private: |
718 int error_ = 0; | 720 int error_ = 0; |
719 }; | 721 }; |
720 | 722 |
721 } // namespace cricket | 723 } // namespace cricket |
722 | 724 |
723 #endif // WEBRTC_P2P_BASE_PORT_H_ | 725 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |