This is a simple example how to log messages through the Dim network using MessageDimTX. Here we are offering the time once a second.
The program is stopped by CTRL-C
#include <iostream>
int main(
int,
const char **)
{
setenv("DIM_DNS_NODE", "localhost", 0);
std::cout << "Offering TIME/MESSAGE...\n" << std::endl;
while (1)
{
usleep(1000000);
while (*ids)
{
std::cout << *ids << std::endl;
ids++;
}
}
return 0;
}