Ich habe den folgenden Code, und ich versuche, eine capnp Nachricht über ZMQ senden an:kann nicht capnp Nachrichten über ZMQ
::capnp::MallocMessageBuilder message;
Guitar::Builder guitar = message.initRoot<Guitar>();
guitar.setModel(1);
guitar.setPrice(1200);
kj::Array<capnp::word> words = messageToFlatArray(message);
_publisher.send(words);
Ich bin mit dem Publish-Subscribe-Muster & Ich erhalte die folgende Fehlermeldung:
error: no matching member function for call to
'send'
_publisher.send(words);
~~~~~~~~~~~^~~~ /usr/local/include/zmq.hpp:610:21: note: candidate function not viable: no known conversion from
'kj::Array<capnp::word>' to
'zmq::message_t &' for 1st argument
inline bool send (message_t &msg_, int flags_ = 0)
^/usr/local/include/zmq.hpp:627:21: note: candidate function not viable: no known conversion from
'kj::Array<capnp::word>' to
'zmq::message_t' for 1st argument
inline bool send (message_t &&msg_, int flags_ = 0)
^/usr/local/include/zmq.hpp:620:35: note: candidate function template not viable: requires at least 2 arguments,
but 1 was
provided
template<typename I bool send(I first, I last, int flags_=0)
^/usr/local/include/zmq.hpp:600:23: note: candidate function not viable: requires at least 2 arguments,
but 1 was provided
inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
Ich habe kj :: ArrayPtr Bytes = words.asBytes(); _ publisher.send (Bytes); Ich bekomme immer noch einen ähnlichen Fehler: keine bekannte Konvertierung von 'kj :: ArrayPtr ' zu 'zmq :: message_t &' @Ditofry –
nik