31 #include <system_error>
38 #define ELECTRONEUM_ZMQ_CHECK(...) \
41 if (( __VA_ARGS__ ) < 0) \
42 return {::net::zmq::get_error_code()}; \
46 #define ELECTRONEUM_LOG_ZMQ_ERROR(...) \
49 MERROR( __VA_ARGS__ << ": " << ::net::zmq::get_error_code().message()); \
53 #define ELECTRONEUM_ZMQ_THROW(msg) \
54 ELECTRONEUM_THROW( ::net::zmq::get_error_code(), msg )
78 static void call(
void* ptr) noexcept;
98 using context = std::unique_ptr<void, terminate>;
101 using socket = std::unique_ptr<void, close>;
Calls zmq_term
Definition: zmq.h:77
static void call(void *ptr) noexcept
Definition: zmq.cpp:81
void operator()(void *ptr) const noexcept
Definition: zmq.h:80
std::error_category const & error_category() noexcept
Definition: error.cpp:92
const std::error_category & error_category() noexcept
Definition: zmq.cpp:40
std::error_code get_error_code() noexcept
Definition: zmq.h:70
expect< void > send(const epee::span< const std::uint8_t > payload, void *const socket, const int flags) noexcept
Definition: zmq.cpp:182
std::unique_ptr< void, close > socket
Unique ZMQ socket handle, calls zmq_close on destruction.
Definition: zmq.h:101
std::error_code make_error_code(int code) noexcept
Definition: zmq.h:64
expect< std::string > receive(void *const socket, const int flags)
Definition: zmq.cpp:175
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
Definition: zmq.h:98
Calls zmq_close
Definition: zmq.h:89
void operator()(void *ptr) const noexcept
Definition: zmq.h:90