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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 bool writable() const { return write_state_ == STATE_WRITABLE; } | 454 bool writable() const { return write_state_ == STATE_WRITABLE; } |
455 bool receiving() const { return receiving_; } | 455 bool receiving() const { return receiving_; } |
456 | 456 |
457 // Determines whether the connection has finished connecting. This can only | 457 // Determines whether the connection has finished connecting. This can only |
458 // be false for TCP connections. | 458 // be false for TCP connections. |
459 bool connected() const { return connected_; } | 459 bool connected() const { return connected_; } |
460 bool weak() const { return !(writable() && receiving() && connected()); } | 460 bool weak() const { return !(writable() && receiving() && connected()); } |
461 bool active() const { | 461 bool active() const { |
462 return write_state_ != STATE_WRITE_TIMEOUT; | 462 return write_state_ != STATE_WRITE_TIMEOUT; |
463 } | 463 } |
| 464 virtual bool ReadyToSendMedia() const { |
| 465 return write_state_ == STATE_WRITABLE || |
| 466 write_state_ == STATE_WRITE_UNRELIABLE; |
| 467 } |
| 468 |
464 // A connection is dead if it can be safely deleted. | 469 // A connection is dead if it can be safely deleted. |
465 bool dead(int64_t now) const; | 470 bool dead(int64_t now) const; |
466 | 471 |
467 // Estimate of the round-trip time over this connection. | 472 // Estimate of the round-trip time over this connection. |
468 int rtt() const { return rtt_; } | 473 int rtt() const { return rtt_; } |
469 | 474 |
470 ConnectionInfo stats(); | 475 ConnectionInfo stats(); |
471 | 476 |
472 sigslot::signal1<Connection*> SignalStateChange; | 477 sigslot::signal1<Connection*> SignalStateChange; |
473 | 478 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 const rtc::PacketOptions& options) override; | 685 const rtc::PacketOptions& options) override; |
681 int GetError() override { return error_; } | 686 int GetError() override { return error_; } |
682 | 687 |
683 private: | 688 private: |
684 int error_ = 0; | 689 int error_ = 0; |
685 }; | 690 }; |
686 | 691 |
687 } // namespace cricket | 692 } // namespace cricket |
688 | 693 |
689 #endif // WEBRTC_P2P_BASE_PORT_H_ | 694 #endif // WEBRTC_P2P_BASE_PORT_H_ |
OLD | NEW |