Chromium Code Reviews| 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 | 477 |
| 478 // The connection can send and receive packets asynchronously. This matches | 478 // The connection can send and receive packets asynchronously. This matches |
| 479 // the interface of AsyncPacketSocket, which may use UDP or TCP under the | 479 // the interface of AsyncPacketSocket, which may use UDP or TCP under the |
| 480 // covers. | 480 // covers. |
| 481 virtual int Send(const void* data, size_t size, | 481 virtual int Send(const void* data, size_t size, |
| 482 const rtc::PacketOptions& options) = 0; | 482 const rtc::PacketOptions& options) = 0; |
| 483 | 483 |
| 484 // Error if Send() returns < 0 | 484 // Error if Send() returns < 0 |
| 485 virtual int GetError() = 0; | 485 virtual int GetError() = 0; |
| 486 | 486 |
| 487 virtual bool ReadyToSendMedia() const { | |
|
pthatcher1
2016/06/08 18:26:39
Why not just connected()?
honghaiz3
2016/06/08 18:36:42
connected() has already been used in the class.
pthatcher1
2016/06/08 18:46:58
Ah, now you make me realize that this is almost th
honghaiz3
2016/06/09 16:37:34
See my reply in the email (and the post of this ch
| |
| 488 return write_state_ == STATE_WRITABLE || | |
| 489 write_state_ == STATE_WRITE_UNRELIABLE; | |
| 490 } | |
| 491 | |
| 487 sigslot::signal4<Connection*, const char*, size_t, const rtc::PacketTime&> | 492 sigslot::signal4<Connection*, const char*, size_t, const rtc::PacketTime&> |
| 488 SignalReadPacket; | 493 SignalReadPacket; |
| 489 | 494 |
| 490 sigslot::signal1<Connection*> SignalReadyToSend; | 495 sigslot::signal1<Connection*> SignalReadyToSend; |
| 491 | 496 |
| 492 // Called when a packet is received on this connection. | 497 // Called when a packet is received on this connection. |
| 493 void OnReadPacket(const char* data, size_t size, | 498 void OnReadPacket(const char* data, size_t size, |
| 494 const rtc::PacketTime& packet_time); | 499 const rtc::PacketTime& packet_time); |
| 495 | 500 |
| 496 // Called when the socket is currently able to send. | 501 // Called when the socket is currently able to send. |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 const rtc::PacketOptions& options) override; | 670 const rtc::PacketOptions& options) override; |
| 666 int GetError() override { return error_; } | 671 int GetError() override { return error_; } |
| 667 | 672 |
| 668 private: | 673 private: |
| 669 int error_ = 0; | 674 int error_ = 0; |
| 670 }; | 675 }; |
| 671 | 676 |
| 672 } // namespace cricket | 677 } // namespace cricket |
| 673 | 678 |
| 674 #endif // WEBRTC_P2P_BASE_PORT_H_ | 679 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |