| 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 // This signal will be fired if this connection is nominated by the | 556 // This signal will be fired if this connection is nominated by the |
| 557 // controlling side. | 557 // controlling side. |
| 558 sigslot::signal1<Connection*> SignalNominated; | 558 sigslot::signal1<Connection*> SignalNominated; |
| 559 | 559 |
| 560 // Invoked when Connection receives STUN error response with 487 code. | 560 // Invoked when Connection receives STUN error response with 487 code. |
| 561 void HandleRoleConflictFromPeer(); | 561 void HandleRoleConflictFromPeer(); |
| 562 | 562 |
| 563 State state() const { return state_; } | 563 State state() const { return state_; } |
| 564 | 564 |
| 565 int num_pings_sent() const { return num_pings_sent_; } |
| 566 |
| 565 IceMode remote_ice_mode() const { return remote_ice_mode_; } | 567 IceMode remote_ice_mode() const { return remote_ice_mode_; } |
| 566 | 568 |
| 567 uint32_t ComputeNetworkCost() const; | 569 uint32_t ComputeNetworkCost() const; |
| 568 | 570 |
| 569 // Update the ICE password and/or generation of the remote candidate if a | 571 // Update the ICE password and/or generation of the remote candidate if a |
| 570 // ufrag in |remote_ice_parameters| matches the candidate's ufrag, and the | 572 // ufrag in |remote_ice_parameters| matches the candidate's ufrag, and the |
| 571 // candidate's password and/or ufrag has not been set. | 573 // candidate's password and/or ufrag has not been set. |
| 572 // |remote_ice_parameters| should be a list of known ICE parameters ordered | 574 // |remote_ice_parameters| should be a list of known ICE parameters ordered |
| 573 // by generation. | 575 // by generation. |
| 574 void MaybeSetRemoteIceCredentialsAndGeneration(const std::string& ice_ufrag, | 576 void MaybeSetRemoteIceCredentialsAndGeneration(const std::string& ice_ufrag, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 643 |
| 642 private: | 644 private: |
| 643 void MaybeAddPrflxCandidate(ConnectionRequest* request, | 645 void MaybeAddPrflxCandidate(ConnectionRequest* request, |
| 644 StunMessage* response); | 646 StunMessage* response); |
| 645 | 647 |
| 646 bool reported_; | 648 bool reported_; |
| 647 State state_; | 649 State state_; |
| 648 // Time duration to switch from receiving to not receiving. | 650 // Time duration to switch from receiving to not receiving. |
| 649 int receiving_timeout_; | 651 int receiving_timeout_; |
| 650 int64_t time_created_ms_; | 652 int64_t time_created_ms_; |
| 653 int num_pings_sent_ = 0; |
| 651 | 654 |
| 652 friend class Port; | 655 friend class Port; |
| 653 friend class ConnectionRequest; | 656 friend class ConnectionRequest; |
| 654 }; | 657 }; |
| 655 | 658 |
| 656 // ProxyConnection defers all the interesting work to the port. | 659 // ProxyConnection defers all the interesting work to the port. |
| 657 class ProxyConnection : public Connection { | 660 class ProxyConnection : public Connection { |
| 658 public: | 661 public: |
| 659 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); | 662 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); |
| 660 | 663 |
| 661 int Send(const void* data, | 664 int Send(const void* data, |
| 662 size_t size, | 665 size_t size, |
| 663 const rtc::PacketOptions& options) override; | 666 const rtc::PacketOptions& options) override; |
| 664 int GetError() override { return error_; } | 667 int GetError() override { return error_; } |
| 665 | 668 |
| 666 private: | 669 private: |
| 667 int error_ = 0; | 670 int error_ = 0; |
| 668 }; | 671 }; |
| 669 | 672 |
| 670 } // namespace cricket | 673 } // namespace cricket |
| 671 | 674 |
| 672 #endif // WEBRTC_P2P_BASE_PORT_H_ | 675 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |