[zeromq-dev] Easy way to send/recv messages?

Matt Weinstein matt_weinstein at yahoo.com
Tue Aug 3 11:41:30 CEST 2010


It's pretty early in the morning here, but are you just proposing copy  
wrappers?

int zmq_sendcopy
	init msg
	copy data
	send msg
	return status

int zmq_recvcopy
	init msg
	recv msg
	copy data
	return status

These would be trivial to implement as helper functions, I would  
think ...
?

On Aug 3, 2010, at 3:40 AM, Martin Sustrik wrote:

> Hi all,
>
> Reading Pieter's manual to 0MQ messages here:
>
> http://www.zeromq.org/docs:user-guide#toc9
>
> I've come to realise how complex the whole thing is.
>
> Now imagine there would be API that'll look like this:
>
> int zmq_send (void *s, const void *buf, size_t len, int flags);
> int zmq_recv (void *s, void *buf, size_t len, int flags);
>
> Note the ease of use and the fact that it maps 1:1 to POSIX socket  
> API.
>
> Existing zero-copy message API can then be provided as a separate  
> set of
> functions:
>
> int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags);
> int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags);
>
> The above would break backward compatibility so it's not an option  
> now,
> however, it looks like something to keep in mind for the future.
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev




More information about the zeromq-dev mailing list