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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 remote_ice_mode_ = mode; | 503 remote_ice_mode_ = mode; |
504 } | 504 } |
505 | 505 |
506 void set_receiving_timeout(uint32_t receiving_timeout_ms) { | 506 void set_receiving_timeout(uint32_t receiving_timeout_ms) { |
507 receiving_timeout_ = receiving_timeout_ms; | 507 receiving_timeout_ = receiving_timeout_ms; |
508 } | 508 } |
509 | 509 |
510 // Makes the connection go away. | 510 // Makes the connection go away. |
511 void Destroy(); | 511 void Destroy(); |
512 | 512 |
| 513 // Makes the connection go away, in a failed state. |
| 514 void FailAndDestroy(); |
| 515 |
513 // Checks that the state of this connection is up-to-date. The argument is | 516 // Checks that the state of this connection is up-to-date. The argument is |
514 // the current time, which is compared against various timeouts. | 517 // the current time, which is compared against various timeouts. |
515 void UpdateState(uint32_t now); | 518 void UpdateState(uint32_t now); |
516 | 519 |
517 // Called when this connection should try checking writability again. | 520 // Called when this connection should try checking writability again. |
518 uint32_t last_ping_sent() const { return last_ping_sent_; } | 521 uint32_t last_ping_sent() const { return last_ping_sent_; } |
519 void Ping(uint32_t now); | 522 void Ping(uint32_t now); |
520 void ReceivedPingResponse(); | 523 void ReceivedPingResponse(); |
521 | 524 |
522 // Called whenever a valid ping is received on this connection. This is | 525 // Called whenever a valid ping is received on this connection. This is |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 bool reported_; | 624 bool reported_; |
622 State state_; | 625 State state_; |
623 // Time duration to switch from receiving to not receiving. | 626 // Time duration to switch from receiving to not receiving. |
624 uint32_t receiving_timeout_; | 627 uint32_t receiving_timeout_; |
625 uint32_t time_created_ms_; | 628 uint32_t time_created_ms_; |
626 | 629 |
627 friend class Port; | 630 friend class Port; |
628 friend class ConnectionRequest; | 631 friend class ConnectionRequest; |
629 }; | 632 }; |
630 | 633 |
631 // ProxyConnection defers all the interesting work to the port | 634 // ProxyConnection defers all the interesting work to the port. |
632 class ProxyConnection : public Connection { | 635 class ProxyConnection : public Connection { |
633 public: | 636 public: |
634 ProxyConnection(Port* port, size_t index, const Candidate& candidate); | 637 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); |
635 | 638 |
636 virtual int Send(const void* data, size_t size, | 639 int Send(const void* data, |
637 const rtc::PacketOptions& options); | 640 size_t size, |
638 virtual int GetError() { return error_; } | 641 const rtc::PacketOptions& options) override; |
| 642 int GetError() override { return error_; } |
639 | 643 |
640 private: | 644 private: |
641 int error_; | 645 int error_ = 0; |
642 }; | 646 }; |
643 | 647 |
644 } // namespace cricket | 648 } // namespace cricket |
645 | 649 |
646 #endif // WEBRTC_P2P_BASE_PORT_H_ | 650 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |