summaryrefslogtreecommitdiff
path: root/src/blu_cat/net/common/connection.hpp
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2025-03-28 14:53:08 -0300
committerFrederico Linhares <fred@linhares.blue>2025-03-28 14:53:08 -0300
commit76c2fd91a71585bfccf8ae9e30834a37514de24f (patch)
treee4a717639d6329c2e6638defadef3b62cf522259 /src/blu_cat/net/common/connection.hpp
parent600a4f7586a31990cfdb02ab811768ca6afc909e (diff)
feat Simplify interface for net connections
Diffstat (limited to 'src/blu_cat/net/common/connection.hpp')
-rw-r--r--src/blu_cat/net/common/connection.hpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/blu_cat/net/common/connection.hpp b/src/blu_cat/net/common/connection.hpp
index c5683cb..bdce8b3 100644
--- a/src/blu_cat/net/common/connection.hpp
+++ b/src/blu_cat/net/common/connection.hpp
@@ -26,7 +26,6 @@
#include "connection_callback.hpp"
#include "message.hpp"
-#include "message_callback.hpp"
#include "tsqueue.hpp"
namespace BluCat::NET
@@ -42,7 +41,6 @@ protected:
TSQueue<Message> messages;
Message reading_message;
- MessageCallback *message_callback;
ConnectionCallback *connection_callback;
void
@@ -55,11 +53,10 @@ public:
bool
send(const uint32_t id, const std::vector<uint8_t> &msg);
- void
- read_messages();
+ bool
+ read_message(Message *m);
- Connection(MessageCallback *message_callback,
- ConnectionCallback *connection_callback,
+ Connection(ConnectionCallback *connection_callback,
asio::io_context &io_context, asio::ip::tcp::socket socket,
unsigned long index);