|
CppZmqZoltanExt 0.0.1
|
Helper utilities for robust ZMQ message sending and receiving. More...
#include <zmq.hpp>#include "cppzmqzoltanext/czze_export.h"

Go to the source code of this file.
Functions | |
| template<typename T > | |
| CZZE_EXPORT zmq::send_result_t | zmqzext::send_retry_on_eintr (T &socket, zmq::const_buffer const &buf, zmq::send_flags flags=zmq::send_flags::none) |
| Send a message buffer with automatic retry on EINTR. | |
| template<typename T > | |
| CZZE_EXPORT zmq::send_result_t | zmqzext::send_retry_on_eintr (T &socket, zmq::message_t &msg, zmq::send_flags flags=zmq::send_flags::none) |
| Send a ZMQ message with automatic retry on EINTR. | |
| template<typename T > | |
| CZZE_EXPORT zmq::send_result_t | zmqzext::send_retry_on_eintr (T &socket, zmq::message_t &&msg, zmq::send_flags flags=zmq::send_flags::none) |
| Send a ZMQ message (rvalue) with automatic retry on EINTR. | |
| template<typename T > | |
| CZZE_EXPORT zmq::recv_buffer_result_t | zmqzext::recv_retry_on_eintr (T &socket, zmq::mutable_buffer const &buf, zmq::recv_flags flags=zmq::recv_flags::none) |
| Receive data into a buffer with automatic retry on EINTR. | |
| template<typename T > | |
| CZZE_EXPORT zmq::recv_result_t | zmqzext::recv_retry_on_eintr (T &socket, zmq::message_t &msg, zmq::recv_flags flags=zmq::recv_flags::none) |
| Receive a message with automatic retry on EINTR. | |
Helper utilities for robust ZMQ message sending and receiving.
This header provides utility functions that wrap ZMQ send and receive operations with automatic retry logic for handling EINTR errors. These helpers ensure that signal interruptions do not prematurely terminate socket operations.
The module implements retrying operations that are interrupted by signals, allowing applications to safely use signal handlers without compromising message delivery.
Key features:
Distributed under the MIT License (MIT) (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
Definition in file helpers.h.
| CZZE_EXPORT zmq::recv_result_t zmqzext::recv_retry_on_eintr | ( | T & | socket, |
| zmq::message_t & | msg, | ||
| zmq::recv_flags | flags = zmq::recv_flags::none |
||
| ) |
Receive a message with automatic retry on EINTR.
Receives a ZMQ message from a socket, automatically retrying if the operation is interrupted by a signal. The message object is populated with the received data.
| socket | The ZMQ socket to receive data from |
| msg | Reference to the message object to populate with received data |
| flags | Optional ZMQ receive flags (default: none) |
| zmq::error_t | if an error occurs (other than EINTR) |
Definition at line 103 of file helpers.cpp.
| CZZE_EXPORT zmq::recv_buffer_result_t zmqzext::recv_retry_on_eintr | ( | T & | socket, |
| zmq::mutable_buffer const & | buf, | ||
| zmq::recv_flags | flags = zmq::recv_flags::none |
||
| ) |
Receive data into a buffer with automatic retry on EINTR.
Receives data from a ZMQ socket into a mutable buffer, automatically retrying if the operation is interrupted by a signal.
| socket | The ZMQ socket to receive data from |
| buf | The mutable buffer to receive data into |
| flags | Optional ZMQ receive flags (default: none) |
| zmq::error_t | if an error occurs (other than EINTR) |
Definition at line 85 of file helpers.cpp.
| CZZE_EXPORT zmq::send_result_t zmqzext::send_retry_on_eintr | ( | T & | socket, |
| zmq::const_buffer const & | buf, | ||
| zmq::send_flags | flags = zmq::send_flags::none |
||
| ) |
Send a message buffer with automatic retry on EINTR.
Sends data from a const buffer through a ZMQ socket, automatically retrying if the operation is interrupted by a signal.
| socket | The ZMQ socket to send data through |
| buf | The constant buffer containing data to send |
| flags | Optional ZMQ send flags (default: none) |
| zmq::error_t | if an error occurs (other than EINTR) |
Definition at line 43 of file helpers.cpp.
| CZZE_EXPORT zmq::send_result_t zmqzext::send_retry_on_eintr | ( | T & | socket, |
| zmq::message_t && | msg, | ||
| zmq::send_flags | flags = zmq::send_flags::none |
||
| ) |
Send a ZMQ message (rvalue) with automatic retry on EINTR.
Sends a temporary ZMQ message through a socket, automatically retrying if the operation is interrupted by a signal.
| socket | The ZMQ socket to send data through |
| msg | Rvalue reference to the message to send |
| flags | Optional ZMQ send flags (default: none) |
| zmq::error_t | if an error occurs (other than EINTR) |
Definition at line 79 of file helpers.cpp.
| CZZE_EXPORT zmq::send_result_t zmqzext::send_retry_on_eintr | ( | T & | socket, |
| zmq::message_t & | msg, | ||
| zmq::send_flags | flags = zmq::send_flags::none |
||
| ) |
Send a ZMQ message with automatic retry on EINTR.
Sends a ZMQ message object through a socket, automatically retrying if the operation is interrupted by a signal.
| socket | The ZMQ socket to send data through |
| msg | Reference to the message to send |
| flags | Optional ZMQ send flags (default: none) |
| zmq::error_t | if an error occurs (other than EINTR) |
Definition at line 61 of file helpers.cpp.