aboutsummaryrefslogtreecommitdiff
path: root/include/Rpc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Rpc.hpp')
-rw-r--r--include/Rpc.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/Rpc.hpp b/include/Rpc.hpp
new file mode 100644
index 0000000..c8b47e0
--- /dev/null
+++ b/include/Rpc.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <zmq.hpp>
+#include "types.hpp"
+#include <functional>
+
+namespace dchat
+{
+ using RpcRecvCallbackFunc = std::function<void(zmq::message_t*)>;
+
+ class Rpc
+ {
+ public:
+ Rpc(u16 port);
+ void recv(RpcRecvCallbackFunc recvCallbackFunc);
+ bool send(const void *data, const usize size);
+ private:
+ zmq::context_t context;
+ zmq::socket_t socket;
+ };
+} \ No newline at end of file