[zeromq-dev] Send files

john skaller skaller at users.sourceforge.net
Sun Feb 19 14:37:14 CET 2012

On 20/02/2012, at 12:26 AM, Marco Trapanese wrote:
> If I understand well the documentation I need to read the source file in 
> small block of data, because 0MQ cannot manage large file directly.

These days, 1 Meg is a trivially small block of data. I can't see any 
reason 0MQ couldn't handle it.

On Windows there is a potentially faster way using sendfile,
that copies a disk file directly to a socket.

But I'd just do it the simplest way. See if it works.

Breaking the file up in to a multi-part message won't save on storage
because the whole thing is stored before it is sent or becomes
readable at the other end.

Breaking it up into separate messages with separate ack's in user space
will just complicate your program.

Libraries like 0MQ are designed to relieve you of some burdens.
Not much point using them if you try to take over what they're designed
to do.

john skaller
skaller at users.sourceforge.net

More information about the zeromq-dev mailing list