this->ctx = zmq_ctx_new();
this->socket = zmq_socket(ctx, ZMQ_RADIO);
zmq_connect(this->socket, "udp://224.0.0.1:5555");
zmq_msg_t msg;
zmq_msg_init_data(&msg, byteArray.begin(), byteArray.size(), NULL, NULL);
zmq_msg_set_group(&msg, "TestMCGroup");
zmq_msg_send(&msg, this->socket, 0);
zmq_msg_close(&msg); this->ctx = zmq_ctx_new();
this->socket = zmq_socket(ctx, ZMQ_DISH);
zmq_bind(socket, "udp://224.0.0.1:5555");
zmq_join(this->socket, "TestMCGroup")
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
zmq_msg_init_data(&msg, byteArray.begin(), byteArray.size(), NULL, NULL);
This is the crucial call to zeromq for creating a zeromq message with zero-copy effort. Here is the API-Reference for this method.
Short arguments summary:
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
-- Distributed Systems Research Group Stephan Opfer T. +49 561 804-6280 F. +49 561 804-6277 Univ. Kassel, FB 16, Wilhelmshöher Allee 73, D-34121 Kassel WWW: http://www.uni-kassel.de/go/vs_stephan-opfer/
Hi Kenton,
thanks for fishing my message out of the spam filter (was driving crazy to write the message a third time :) ).
Currently I have changed my code a little. I send the wordArray now directly. That works, as long as I keep the capnproto message in memory, until zmq has sent its content. That is, because I try to sent it with zero-copy semantic.
So my situation/problem is like this:
zmq_msg_init_data(&msg, byteArray.begin(), byteArray.size(), NULL, NULL);
This is the crucial call to zeromq for creating a zeromq message with zero-copy effort. Here is the API-Reference for this method.
Short arguments summary:
The question is: How can I keep the message content, until zeromq cleaned it up and how to I recognize that zeromq clean it up.
- The zeromq message to be created
- Pointer to the start of the data or content of the message
- The size of the data, the pointer is pointing to.
- Function-Pointer of the form void(void*,void*). This method will be called, when zeromq cleans up the message content. First argument of the function is the pointer to the messages content. The second argument is the pointer you can pass as 5. argument (see next).
- void* that will be the second argument of the function in argument 4.
Passing a shared_ptr as 5th argument does not work, according to the zeromq dev mailing list. It also seems that the function (4th argument) must be static (not sure about that).
Basically my c++ software engineering skills come to an end here. I think, that it must work somehow, but I couldn't find it out, so far. Some snippets would be nice... :)
Greetings,
Stephan
-Kenton
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.