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