diff options
author | Lee Clagett <code@leeclagett.com> | 2019-08-18 13:49:02 -0400 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2019-07-22 06:37:16 +0000 |
commit | f91a06c6d7ec3d649b6bdb7a38bb1e0b8f7293f9 (patch) | |
tree | 9d3eeae2f54baf34a54376c8a51f09501b03f991 /src/rpc/zmq_server.h | |
parent | Merge pull request #5824 (diff) | |
download | monero-f91a06c6d7ec3d649b6bdb7a38bb1e0b8f7293f9.tar.xz |
Dropping cppzmq dependency; adding some zmq utils
Diffstat (limited to '')
-rw-r--r-- | src/rpc/zmq_server.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/rpc/zmq_server.h b/src/rpc/zmq_server.h index 1b1e4c7cf..ce7892dab 100644 --- a/src/rpc/zmq_server.h +++ b/src/rpc/zmq_server.h @@ -29,12 +29,10 @@ #pragma once #include <boost/thread/thread.hpp> -#include <zmq.hpp> -#include <string> -#include <memory> +#include <boost/utility/string_ref.hpp> #include "common/command_line.h" - +#include "net/zmq.h" #include "rpc_handler.h" namespace cryptonote @@ -43,9 +41,6 @@ namespace cryptonote namespace rpc { -static constexpr int DEFAULT_NUM_ZMQ_THREADS = 1; -static constexpr int DEFAULT_RPC_RECV_TIMEOUT_MS = 1000; - class ZmqServer { public: @@ -58,8 +53,8 @@ class ZmqServer void serve(); - bool addIPCSocket(std::string address, std::string port); - bool addTCPSocket(std::string address, std::string port); + bool addIPCSocket(boost::string_ref address, boost::string_ref port); + bool addTCPSocket(boost::string_ref address, boost::string_ref port); void run(); void stop(); @@ -67,14 +62,11 @@ class ZmqServer private: RpcHandler& handler; - volatile bool stop_signal; - volatile bool running; - - zmq::context_t context; + net::zmq::context context; boost::thread run_thread; - std::unique_ptr<zmq::socket_t> rep_socket; + net::zmq::socket rep_socket; }; |