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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 // Called when a connection is determined to be no longer useful to us. We | 477 // Called when a connection is determined to be no longer useful to us. We |
478 // still keep it around in case the other side wants to use it. But we can | 478 // still keep it around in case the other side wants to use it. But we can |
479 // safely stop pinging on it and we can allow it to time out if the other | 479 // safely stop pinging on it and we can allow it to time out if the other |
480 // side stops using it as well. | 480 // side stops using it as well. |
481 bool pruned() const { return pruned_; } | 481 bool pruned() const { return pruned_; } |
482 void Prune(); | 482 void Prune(); |
483 | 483 |
484 bool use_candidate_attr() const { return use_candidate_attr_; } | 484 bool use_candidate_attr() const { return use_candidate_attr_; } |
485 void set_use_candidate_attr(bool enable); | 485 void set_use_candidate_attr(bool enable); |
486 | 486 |
487 bool nominated() const { return nominated_; } | |
488 void set_nominated(bool nominated) { nominated_ = nominated; } | |
pthatcher1
2015/08/18 20:47:00
Should set_nominated fire SignalNominated?
| |
489 | |
487 void set_remote_ice_mode(IceMode mode) { | 490 void set_remote_ice_mode(IceMode mode) { |
488 remote_ice_mode_ = mode; | 491 remote_ice_mode_ = mode; |
489 } | 492 } |
490 | 493 |
491 // Makes the connection go away. | 494 // Makes the connection go away. |
492 void Destroy(); | 495 void Destroy(); |
493 | 496 |
494 // Checks that the state of this connection is up-to-date. The argument is | 497 // Checks that the state of this connection is up-to-date. The argument is |
495 // the current time, which is compared against various timeouts. | 498 // the current time, which is compared against various timeouts. |
496 void UpdateState(uint32 now); | 499 void UpdateState(uint32 now); |
(...skipping 11 matching lines...) Expand all Loading... | |
508 // Debugging description of this connection | 511 // Debugging description of this connection |
509 std::string ToDebugId() const; | 512 std::string ToDebugId() const; |
510 std::string ToString() const; | 513 std::string ToString() const; |
511 std::string ToSensitiveString() const; | 514 std::string ToSensitiveString() const; |
512 // Prints pings_since_last_response_ into a string. | 515 // Prints pings_since_last_response_ into a string. |
513 void PrintPingsSinceLastResponse(std::string* pings, size_t max); | 516 void PrintPingsSinceLastResponse(std::string* pings, size_t max); |
514 | 517 |
515 bool reported() const { return reported_; } | 518 bool reported() const { return reported_; } |
516 void set_reported(bool reported) { reported_ = reported;} | 519 void set_reported(bool reported) { reported_ = reported;} |
517 | 520 |
518 // This flag will be set if this connection is the chosen one for media | 521 // This signal will be fired if this connection is nominated by the |
519 // transmission. This connection will send STUN ping with USE-CANDIDATE | 522 // controlling side. |
520 // attribute. | 523 sigslot::signal1<Connection*> SignalNominated; |
521 sigslot::signal1<Connection*> SignalUseCandidate; | |
522 | 524 |
523 // Invoked when Connection receives STUN error response with 487 code. | 525 // Invoked when Connection receives STUN error response with 487 code. |
524 void HandleRoleConflictFromPeer(); | 526 void HandleRoleConflictFromPeer(); |
525 | 527 |
526 State state() const { return state_; } | 528 State state() const { return state_; } |
527 | 529 |
528 IceMode remote_ice_mode() const { return remote_ice_mode_; } | 530 IceMode remote_ice_mode() const { return remote_ice_mode_; } |
529 | 531 |
530 // Update the ICE password of the remote candidate if |ice_ufrag| matches | 532 // Update the ICE password of the remote candidate if |ice_ufrag| matches |
531 // the candidate's ufrag, and the candidate's passwrod has not been set. | 533 // the candidate's ufrag, and the candidate's passwrod has not been set. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 void OnMessage(rtc::Message *pmsg); | 572 void OnMessage(rtc::Message *pmsg); |
571 | 573 |
572 Port* port_; | 574 Port* port_; |
573 size_t local_candidate_index_; | 575 size_t local_candidate_index_; |
574 Candidate remote_candidate_; | 576 Candidate remote_candidate_; |
575 ReadState read_state_; | 577 ReadState read_state_; |
576 WriteState write_state_; | 578 WriteState write_state_; |
577 bool connected_; | 579 bool connected_; |
578 bool pruned_; | 580 bool pruned_; |
579 // By default |use_candidate_attr_| flag will be true, | 581 // By default |use_candidate_attr_| flag will be true, |
580 // as we will be using agrressive nomination. | 582 // as we will be using aggressive nomination. |
581 // But when peer is ice-lite, this flag "must" be initialized to false and | 583 // But when peer is ice-lite, this flag "must" be initialized to false and |
582 // turn on when connection becomes "best connection". | 584 // turn on when connection becomes "best connection". |
583 bool use_candidate_attr_; | 585 bool use_candidate_attr_; |
586 // Whether this connection has been nominated by the controlling side via | |
587 // the use_candidate attribute. | |
588 bool nominated_; | |
584 IceMode remote_ice_mode_; | 589 IceMode remote_ice_mode_; |
585 StunRequestManager requests_; | 590 StunRequestManager requests_; |
586 uint32 rtt_; | 591 uint32 rtt_; |
587 uint32 last_ping_sent_; // last time we sent a ping to the other side | 592 uint32 last_ping_sent_; // last time we sent a ping to the other side |
588 uint32 last_ping_received_; // last time we received a ping from the other | 593 uint32 last_ping_received_; // last time we received a ping from the other |
589 // side | 594 // side |
590 uint32 last_data_received_; | 595 uint32 last_data_received_; |
591 uint32 last_ping_response_received_; | 596 uint32 last_ping_response_received_; |
592 std::vector<SentPing> pings_since_last_response_; | 597 std::vector<SentPing> pings_since_last_response_; |
593 | 598 |
(...skipping 22 matching lines...) Expand all Loading... | |
616 const rtc::PacketOptions& options); | 621 const rtc::PacketOptions& options); |
617 virtual int GetError() { return error_; } | 622 virtual int GetError() { return error_; } |
618 | 623 |
619 private: | 624 private: |
620 int error_; | 625 int error_; |
621 }; | 626 }; |
622 | 627 |
623 } // namespace cricket | 628 } // namespace cricket |
624 | 629 |
625 #endif // WEBRTC_P2P_BASE_PORT_H_ | 630 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |