aboutsummaryrefslogtreecommitdiff
path: root/include/Rpc.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-08-08 23:17:10 +0200
committerdec05eba <dec05eba@protonmail.com>2018-08-08 23:17:14 +0200
commit06f30543730c372226c398c11b3de0213d711d13 (patch)
treed6229ff224a9e7e5457c856747c2f8726e7a3868 /include/Rpc.hpp
parent26edc563cb0ba1a9fb35507e7f32d2d43a845e68 (diff)
Add support for discord
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