Hi, Matthias
2012/2/8 Matthias Vallentin
A while ago, Maciej Gajewski started an effort to use Asio to observe a ZeroMQ socket [1]. Based on his code, I put together a thin library that wraps the implementation details. Since other have requested a working example, here it is now at github:
Any feedback is highly appreciated. A basic usage example looks like this:
#include
#include int main() { boost::asio::io_service io; bmq::context ctx(1); bmq::component c(ctx, io);
auto sink = c.add_sink(ZMQ_PAIR, "inproc://x"); c.subscribe(sink, [](bmq::message&& msg) { std::string str(static_cast
(msg.data()), msg.size()); std::cout << str << std::endl; }); auto source = c.add_source(ZMQ_PAIR, "inproc://x");
bmq::message msg(const_cast
("foo"), 3, nullptr); source->send(msg); // Execute message handler. io.poll();
return 0; }
... I cannot find this library. Did move repository?
======================== Akira Takahashi mailto:faithandbrave@gmail.com site: https://sites.google.com/site/faithandbrave/about/en