how do i send a file with zmq multipart messages?

An attempt to move all data via multipart-message does collect all data into one immense BLOB, plus add duplicate O/S-level transport-class specific buffers and the most probable result is a crash.

Send individual blocks of the video-BLOB as individual simple-message payloads and reconstruct the BLOB ( best via indexed numbering, having an option to re-request any part, that did not arrive to the receiver-side ).

Using std::async mode with a REQ/REP seems to be a bit tricky for this Archetype must keep its dFSA interleaved sequence of .recv()-.send()-.recv()-.send()-…ad infinitum… as it falls into an unsalvagable mutual deadlock if failed to do so.

For streaming video (like for CV / scene-detection), there are more tricks to put in – one of which is to use ZMQ_CONFLATE option, so as to send but the very recent video-frame, not losing time on “archaic” scene-images, that are already part of the history, and thus delivering always but the very recent video-frame to the receiving-side processing.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top