aboutsummaryrefslogtreecommitdiff
path: root/include/Rpc.hpp
blob: c8b47e089406d2be87778867e9926cfef75b9d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
    };
}