13 auto cport = cnode.
port(
"sender", ZMQ_CLIENT);
14 cport->connect(
"testflows",
"recver");
17 zsys_debug(
"create flows");
23 const int credits_in_play = 2;
26 {
"credit",credits_in_play},
27 {
"direction",
"extract"}};
32 zsys_debug(
"cflow send BOT");
35 zsys_debug(
"cflow recv BOT");
42 std::default_random_engine rng;
43 std::uniform_real_distribution<double> maybe(0,1);
47 zsys_debug (
"cflow send DAT");
52 zsys_debug(
"false return, maybe EOT");
55 zsys_debug(
"have credit %d/%d",
60 if (maybe(rng) > 0.9) {
66 zsys_debug(
"cflow send EOT");
72 zsys_debug(
"cflow recv EOT");
bool recv_eot(Message &msg, int timeout=-1)
Receive an EOT.
An identified vertex in a ported, directed graph.
void online(const headerset_t &extra_headers={})
Bring the node online.
void set_verbose(bool verbose=true)
Set verbose for underlying Zyre and internal debug messages.
void send_eot(Message &msg)
send EOT.
portptr_t port(const std::string &name, int stype)
Create a named port with the given socket type.
bool put(Message &dat)
put a payload message into the flow
bool recv_bot(Message &bot, int timeout=-1)
receive a BOT
void set_label(const std::string &label)
void send_bot(Message &bot)
send a BOT