From e26a20d650e8f414383f70f8b7bd9e62228567d1 Mon Sep 17 00:00:00 2001 From: Joshua Scott Date: Fri, 20 Apr 2018 17:12:31 +0100 Subject: [PATCH] net: Add a method to get the MessageManager instance from a DMLSession --- include/ki/protocol/net/DMLSession.h | 2 ++ src/protocol/net/DMLSession.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/ki/protocol/net/DMLSession.h b/include/ki/protocol/net/DMLSession.h index b5a6a32..8245dc6 100644 --- a/include/ki/protocol/net/DMLSession.h +++ b/include/ki/protocol/net/DMLSession.h @@ -18,6 +18,8 @@ namespace net DMLSession(uint16_t id, const dml::MessageManager &manager); virtual ~DMLSession() = default; + const dml::MessageManager &get_manager() const; + void send_message(const dml::Message &message); protected: void on_application_message(const PacketHeader& header) override; diff --git a/src/protocol/net/DMLSession.cpp b/src/protocol/net/DMLSession.cpp index 54fc9a4..f11a7ed 100644 --- a/src/protocol/net/DMLSession.cpp +++ b/src/protocol/net/DMLSession.cpp @@ -9,6 +9,11 @@ namespace net DMLSession::DMLSession(const uint16_t id, const dml::MessageManager& manager) : Session(id), m_manager(manager) {} + const dml::MessageManager& DMLSession::get_manager() const + { + return m_manager; + } + void DMLSession::send_message(const dml::Message& message) { send_packet(false, 0, message);