| 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 |
| 469 // A connection is dead if it can be safely deleted. | 465 // A connection is dead if it can be safely deleted. |
| 470 bool dead(int64_t now) const; | 466 bool dead(int64_t now) const; |
| 471 | 467 |
| 472 // Estimate of the round-trip time over this connection. | 468 // Estimate of the round-trip time over this connection. |
| 473 int rtt() const { return rtt_; } | 469 int rtt() const { return rtt_; } |
| 474 | 470 |
| 475 ConnectionInfo stats(); | 471 ConnectionInfo stats(); |
| 476 | 472 |
| 477 sigslot::signal1<Connection*> SignalStateChange; | 473 sigslot::signal1<Connection*> SignalStateChange; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 const rtc::PacketOptions& options) override; | 681 const rtc::PacketOptions& options) override; |
| 686 int GetError() override { return error_; } | 682 int GetError() override { return error_; } |
| 687 | 683 |
| 688 private: | 684 private: |
| 689 int error_ = 0; | 685 int error_ = 0; |
| 690 }; | 686 }; |
| 691 | 687 |
| 692 } // namespace cricket | 688 } // namespace cricket |
| 693 | 689 |
| 694 #endif // WEBRTC_P2P_BASE_PORT_H_ | 690 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |