2020-05-21 14:09:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string_view>
|
2021-02-02 14:35:40 +00:00
|
|
|
#include <oxenmq/oxenmq.h>
|
|
|
|
#include <oxenmq/address.h>
|
2020-05-21 14:09:45 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
struct AbstractRouter;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace llarp::rpc
|
|
|
|
{
|
2021-02-03 18:12:21 +00:00
|
|
|
using LMQ_ptr = std::shared_ptr<oxenmq::OxenMQ>;
|
2020-05-21 14:09:45 +00:00
|
|
|
|
|
|
|
struct RpcServer
|
|
|
|
{
|
|
|
|
explicit RpcServer(LMQ_ptr, AbstractRouter*);
|
|
|
|
~RpcServer() = default;
|
|
|
|
void
|
2021-02-03 18:12:21 +00:00
|
|
|
AsyncServeRPC(oxenmq::address addr);
|
2020-05-21 14:09:45 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
LMQ_ptr m_LMQ;
|
|
|
|
AbstractRouter* const m_Router;
|
|
|
|
};
|
|
|
|
} // namespace llarp::rpc
|