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 |
11 #ifndef WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ | 11 #ifndef WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ |
12 #define WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ | 12 #define WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 // This is included for PacketOptions. | |
18 #include "webrtc/base/asyncpacketsocket.h" | |
19 #include "webrtc/base/sigslot.h" | 17 #include "webrtc/base/sigslot.h" |
20 #include "webrtc/base/socket.h" | 18 #include "webrtc/base/socket.h" |
21 | 19 |
22 namespace cricket { | 20 namespace cricket { |
23 class TransportChannel; | 21 class TransportChannel; |
24 } | 22 } |
25 | 23 |
26 namespace rtc { | 24 namespace rtc { |
27 struct PacketOptions; | 25 struct PacketOptions; |
28 struct PacketTime; | 26 struct PacketTime; |
29 struct SentPacket; | 27 struct SentPacket; |
30 | 28 |
31 class PacketTransportInterface : public sigslot::has_slots<> { | 29 class PacketTransportInterface : public sigslot::has_slots<> { |
32 public: | 30 public: |
33 virtual ~PacketTransportInterface() {} | 31 virtual ~PacketTransportInterface() {} |
34 | 32 |
35 // Identify the object for logging and debug purpose. | 33 // Identify the object for logging and debug purpose. |
36 virtual std::string debug_name() const = 0; | 34 virtual const std::string debug_name() const = 0; |
37 | 35 |
38 // The transport has been established. | 36 // The transport has been established. |
39 virtual bool writable() const = 0; | 37 virtual bool writable() const = 0; |
40 | 38 |
41 // The transport has received a packet in the last X milliseconds, here X is | 39 // The transport has received a packet in the last X milliseconds, here X is |
42 // configured by each implementation. | 40 // configured by each implementation. |
43 virtual bool receiving() const = 0; | 41 virtual bool receiving() const = 0; |
44 | 42 |
45 // Attempts to send the given packet. | 43 // Attempts to send the given packet. |
46 // The return value is < 0 on failure. The return value in failure case is not | 44 // The return value is < 0 on failure. The return value in failure case is not |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 SignalReadPacket; | 86 SignalReadPacket; |
89 | 87 |
90 // Signalled each time a packet is sent on this channel. | 88 // Signalled each time a packet is sent on this channel. |
91 sigslot::signal2<PacketTransportInterface*, const rtc::SentPacket&> | 89 sigslot::signal2<PacketTransportInterface*, const rtc::SentPacket&> |
92 SignalSentPacket; | 90 SignalSentPacket; |
93 }; | 91 }; |
94 | 92 |
95 } // namespace rtc | 93 } // namespace rtc |
96 | 94 |
97 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ | 95 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ |
OLD | NEW |