// // Custom routing Router to Mama (ROUTER to REQ) // // Olivier Chamoux #include #include #include #include #include #include "zhelpers.hpp" #include #include #include #include "utils.h" using namespace std; void control() { zmq::context_t context(1); zmq::socket_t worker (context, ZMQ_REQ); srand (time(NULL)); // We use a string identity for ease here string macAddress = getMacAddress(); worker.setsockopt(ZMQ_IDENTITY, macAddress.c_str(), macAddress.length()); worker.connect("tcp://127.0.0.1:123459"); // Tell the router we're ready for work s_send (worker, "ready"); while (1) { std::string cmd = s_recv (worker); vector splitCmd = split(cmd); for (size_t n=0; n