| 6 |
| #define LIBTGVOIP_PACKETSENDER_H |
| 7 |
| 8 | #include "VoIPController.h" |
| 9 |
| 10 | #include <cstdint> |
| 11 | #include <functional> |
| 12 |
| 13 | namespace tgvoip |
| 14 | { |
| 15 |
| 16 | class PacketSender |
| 17 | { |
| 18 | public: |
| 19 | PacketSender(VoIPController* m_controller); |
| 20 | virtual ~PacketSender(); |
| 21 | virtual void PacketAcknowledged(std::uint32_t seq, double sendTime, double ackTime, PktType type, std::uint32_t size) = 0; |
| 22 | virtual void PacketLost(std::uint32_t seq, PktType type, std::uint32_t size) = 0; |
| 23 |
| 24 | protected: |
| 25 | VoIPController* m_controller; |
| 26 |
| 27 | void SendExtra(Buffer& data, ExtraType type) const; |
| 28 | void IncrementUnsentStreamPackets(); |
| 29 | std::uint32_t SendPacket(VoIPController::PendingOutgoingPacket pkt); |
| 30 | [[nodiscard]] double GetConnectionInitTime() const; |
| 31 | [[nodiscard]] const HistoricBuffer<double, 32>& RTTHistory() const; |
| 32 | MessageThread& GetMessageThread(); |
| 33 | [[nodiscard]] const MessageThread& GetMessageThread() const; |
| 34 | [[nodiscard]] const VoIPController::ProtocolInfo& GetProtocolInfo() const; |
| 35 | void SendStreamFlags(VoIPController::Stream& stm) const; |
| 36 | [[nodiscard]] const VoIPController::Config& GetConfig() const; |
| 37 | }; |
| 38 |
| 39 | } // namespace tgvoip |
| 40 |
| 41 | #endif // LIBTGVOIP_PACKETSENDER_H |
| 42 |