OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 18 matching lines...) Loading... | |
29 class PacketTransportInterface : public sigslot::has_slots<> { | 29 class PacketTransportInterface : public sigslot::has_slots<> { |
30 public: | 30 public: |
31 virtual ~PacketTransportInterface() {} | 31 virtual ~PacketTransportInterface() {} |
32 | 32 |
33 // Identify the object for logging and debug purpose. | 33 // Identify the object for logging and debug purpose. |
34 virtual const std::string debug_name() const = 0; | 34 virtual const std::string debug_name() const = 0; |
35 | 35 |
36 // The transport has been established. | 36 // The transport has been established. |
37 virtual bool writable() const = 0; | 37 virtual bool writable() const = 0; |
38 | 38 |
39 // The transport has received at least one packet. | |
pthatcher1
2016/10/31 18:27:30
That's not what receiving() means. It means that
johan
2016/10/31 19:03:31
Ok, I missed the periodic check in Connection::Upd
| |
40 virtual bool receiving() const = 0; | |
41 | |
39 // Attempts to send the given packet. | 42 // Attempts to send the given packet. |
40 // The return value is < 0 on failure. The return value in failure case is not | 43 // The return value is < 0 on failure. The return value in failure case is not |
41 // descriptive. Depending on failure cause and implementation details | 44 // descriptive. Depending on failure cause and implementation details |
42 // GetError() returns an descriptive errno.h error value. | 45 // GetError() returns an descriptive errno.h error value. |
43 // This mimics posix socket send() or sendto() behavior. | 46 // This mimics posix socket send() or sendto() behavior. |
44 // TODO(johan): Reliable, meaningful, consistent error codes for all | 47 // TODO(johan): Reliable, meaningful, consistent error codes for all |
45 // implementations would be nice. | 48 // implementations would be nice. |
46 // TODO(johan): Remove the default argument once channel code is updated. | 49 // TODO(johan): Remove the default argument once channel code is updated. |
47 virtual int SendPacket(const char* data, | 50 virtual int SendPacket(const char* data, |
48 size_t len, | 51 size_t len, |
(...skipping 14 matching lines...) Loading... | |
63 // Emitted when the writable state, represented by |writable()|, changes. | 66 // Emitted when the writable state, represented by |writable()|, changes. |
64 sigslot::signal1<PacketTransportInterface*> SignalWritableState; | 67 sigslot::signal1<PacketTransportInterface*> SignalWritableState; |
65 | 68 |
66 // Emitted when the PacketTransportInterface is ready to send packets. "Ready | 69 // Emitted when the PacketTransportInterface is ready to send packets. "Ready |
67 // to send" is more sensitive than the writable state; a transport may be | 70 // to send" is more sensitive than the writable state; a transport may be |
68 // writable, but temporarily not able to send packets. For example, the | 71 // writable, but temporarily not able to send packets. For example, the |
69 // underlying transport's socket buffer may be full, as indicated by | 72 // underlying transport's socket buffer may be full, as indicated by |
70 // SendPacket's return code and/or GetError. | 73 // SendPacket's return code and/or GetError. |
71 sigslot::signal1<PacketTransportInterface*> SignalReadyToSend; | 74 sigslot::signal1<PacketTransportInterface*> SignalReadyToSend; |
72 | 75 |
76 // Emitted when receiving state changes to true. | |
77 sigslot::signal1<PacketTransportInterface*> SignalReceivingState; | |
78 | |
73 // Signalled each time a packet is received on this channel. | 79 // Signalled each time a packet is received on this channel. |
74 sigslot::signal5<PacketTransportInterface*, | 80 sigslot::signal5<PacketTransportInterface*, |
75 const char*, | 81 const char*, |
76 size_t, | 82 size_t, |
77 const rtc::PacketTime&, | 83 const rtc::PacketTime&, |
78 int> | 84 int> |
79 SignalReadPacket; | 85 SignalReadPacket; |
80 | 86 |
81 // Signalled each time a packet is sent on this channel. | 87 // Signalled each time a packet is sent on this channel. |
82 sigslot::signal2<PacketTransportInterface*, const rtc::SentPacket&> | 88 sigslot::signal2<PacketTransportInterface*, const rtc::SentPacket&> |
83 SignalSentPacket; | 89 SignalSentPacket; |
84 }; | 90 }; |
85 | 91 |
86 } // namespace rtc | 92 } // namespace rtc |
87 | 93 |
88 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ | 94 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ |
OLD | NEW |