A C++ library for distributed co-simulation
Classes | Namespaces | Enumerations | Functions
zmqx.hpp File Reference

Module header for coral::net::zmqx. More...

#include <chrono>
#include <cstdint>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include "zmq.hpp"
#include "coral/config.h"
#include "coral/net.hpp"

Go to the source code of this file.


class  coral::net::zmqx::ReqSocket
 A client socket for communication with a single server node. More...
class  coral::net::zmqx::RepSocket
 A server socket for communication with one or more client nodes in a request-reply pattern. More...


 Networking, communication and general-purpose protocols.
 Functions and classes that extend or wrap the ZeroMQ API.



zmq::context_t & coral::net::zmqx::GlobalContext ()
 Returns a reference to a global ZMQ context. More...
std::uint16_t coral::net::zmqx::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.
std::string coral::net::zmqx::LastEndpoint (zmq::socket_t &socket)
 Returns the value of the ZMQ_LAST_ENDPOINT socket property. More...
std::uint16_t coral::net::zmqx::EndpointPort (const std::string &endpoint)
 Given a string on the form "tcp://addr:port", returns the port number. More...
bool coral::net::zmqx::WaitForOutgoing (zmq::socket_t &socket, std::chrono::milliseconds timeout)
 Waits up to timeout milliseconds to see if a message may be enqueued on socket. More...
bool coral::net::zmqx::WaitForIncoming (zmq::socket_t &socket, std::chrono::milliseconds timeout)
 Waits up to timeout milliseconds for incoming messages on socket. More...
void coral::net::zmqx::Send (zmq::socket_t &socket, std::vector< zmq::message_t > &message, SendFlag flags=SendFlag::none)
 Sends a message. More...
void coral::net::zmqx::Receive (zmq::socket_t &socket, std::vector< zmq::message_t > &message)
 Receives a message. More...
std::string coral::net::zmqx::ToString (const zmq::message_t &frame)
 Returns the content of a message frame as a std::string.
zmq::message_t coral::net::zmqx::ToFrame (const std::string &s)
 Returns a message frame whose contents are equal to s.
bool coral::net::zmqx::Receive (RepSocket &socket, std::vector< zmq::message_t > &message, std::chrono::milliseconds timeout)
 Receives a message, given that one arrives before the timeout is reached. More...

Detailed Description

Module header for coral::net::zmqx.