10 #ifndef CORAL_NET_ZMQX_HPP 11 #define CORAL_NET_ZMQX_HPP 22 #include "coral/config.h" 56 zmq::socket_t& socket,
110 CORAL_DEFINE_BITWISE_ENUM_OPERATORS(
SendFlag)
122 zmq::socket_t& socket,
135 zmq::socket_t& socket,
159 CORAL_DEFINE_DEFAULT_MOVE(
ReqSocket, m_socket)
207 zmq::socket_t& Socket();
208 const zmq::socket_t& Socket()
const;
231 m_socket, m_boundEndpoint, m_clientEnvelope)
304 zmq::socket_t& Socket();
305 const zmq::socket_t& Socket()
const;
329 #endif // header guard std::string LastEndpoint(zmq::socket_t &socket)
Returns the value of the ZMQ_LAST_ENDPOINT socket property.
void Send(zmq::socket_t &socket, std::vector< zmq::message_t > &message, SendFlag flags=SendFlag::none)
Sends a message.
The frames being sent are part of a multiframe message, and more frames are coming.
void Receive(zmq::socket_t &socket, std::vector< zmq::message_t > &message)
Receives a message.
bool WaitForIncoming(zmq::socket_t &socket, std::chrono::milliseconds timeout)
Waits up to timeout milliseconds for incoming messages on socket.
Main module header for coral::net.
std::string ToString(const zmq::message_t &frame)
Returns the content of a message frame as a std::string.
std::uint16_t EndpointPort(const std::string &endpoint)
Given a string on the form "tcp://addr:port", returns the port number.
zmq::message_t ToFrame(const std::string &s)
Returns a message frame whose contents are equal to s.
SendFlag
Flags for the Send() function.
Definition: zmqx.hpp:99
A client socket for communication with a single server node.
Definition: zmqx.hpp:153
A protocol/transport independent endpoint address specification.
Definition: net.hpp:34
Definition: variable_io.hpp:28
zmq::context_t & GlobalContext()
Returns a reference to a global ZMQ context.
std::uint16_t BindToEphemeralPort(zmq::socket_t &socket, const std::string &networkInterface="*")
Binds socket to an ephemeral TCP port on the given network interface and returns the port number...
bool WaitForOutgoing(zmq::socket_t &socket, std::chrono::milliseconds timeout)
Waits up to timeout milliseconds to see if a message may be enqueued on socket.
A server socket for communication with one or more client nodes in a request-reply pattern...
Definition: zmqx.hpp:224