33#include <system_error>
40#define MONERO_ZMQ_CHECK(...) \
43 if (( __VA_ARGS__ ) < 0) \
44 return {::net::zmq::get_error_code()}; \
48#define MONERO_LOG_ZMQ_ERROR(...) \
51 MERROR( __VA_ARGS__ << ": " << ::net::zmq::get_error_code().message()); \
55#define MONERO_ZMQ_THROW(msg) \
56 MONERO_THROW( ::net::zmq::get_error_code(), msg )
77 inline std::error_code get_error_code() noexcept
85 static void call(
void* ptr)
noexcept;
87 void operator()(
void* ptr)
const noexcept
97 void operator()(
void* ptr)
const noexcept
105 using context = std::unique_ptr<void, terminate>;
108 using socket = std::unique_ptr<void, close>;
116 template<
typename F,
typename...
T>
117 expect<void> retry_op(
F op,
T&&... args)
noexcept(
noexcept(op(
args...)))
121 if (0 <= op(
args...))
124 const int error = zmq_errno();
144 expect<std::string>
receive(
void* socket,
int flags = 0);
161 expect<void>
send(epee::span<const std::uint8_t> payload,
void* socket,
int flags = 0) noexcept;
180 expect<
void>
send(epee::byte_slice&& payload,
void* socket,
int flags = 0) noexcept;
static void close()
Definition blockchain_blackball.cpp:279
bool success
Definition cold-transaction.cpp:57
#define inline
Definition inline_c.h:34
static int flags
Definition mdb_load.c:31
args
Definition build_protob.py:10
TODO: (mj-xmr) This will be reduced in an another PR.
Definition byte_slice.h:40
const std::error_category & error_category() noexcept
Definition zmq.cpp:42
expect< void > send(const epee::span< const std::uint8_t > payload, void *const socket, const int flags) noexcept
Definition zmq.cpp:170
expect< std::string > receive(void *const socket, const int flags)
Definition zmq.cpp:163
Definition net_utils_base.h:59
error
General net errors.
Definition error.h:39
std::error_code make_error_code(error value) noexcept
Definition error.h:57
const portMappingElt code
Definition portlistingparse.c:22
#define F(w, k)
Definition sha512-blocks.c:61