Template Function mrpt::serialization::mrpt_recv_from_zmq
Defined in File zmq_serialization.h
Function Documentation
-
template<typename ZMQ_SOCKET_TYPE>
mrpt::serialization::CSerializable::Ptr mrpt::serialization::mrpt_recv_from_zmq(ZMQ_SOCKET_TYPE zmq_socket, bool dont_wait = false, size_t *rx_obj_length_in_bytes = nullptr) Receives an MRPT object from a ZMQ socket, determining the type of the object on-the-fly.
See also
mrpt_recv_from_zmq_into
Note
Including
<mrpt/serialization/serialization_zmq.h>requires libzmq to be available in your system and linked to your user code. This function can be used even if MRPT was built without ZMQ support, thanks to the use of templates.Note
See examples of usage in https://github.com/MRPT/mrpt/tree/master/doc/mrpt-zeromq-example
- Parameters:
zmq_socket – [in] The zmq socket object.
dont_wait – [in] If true, will fail if there is no data ready to be read. If false (default) this function will block until data arrives.
rx_obj_length_in_bytes – [out] If non-nullptr, the object length will be stored here.
- Throws:
std::exception – If the object finds any critical error during de-serialization.
- Returns:
An empty smart pointer if there was any error. The received object if all went OK.