[zeromq-dev] Zero-copy message API
Martin Pales
m.pales at gmail.com
Mon Apr 4 20:23:43 CEST 2011
On Mon, Apr 4, 2011 at 6:40 PM, Ian Barber <ian.barber at gmail.com> wrote:
>
>
> On Mon, Apr 4, 2011 at 5:29 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
>
>> What about calling it zmq_msg_attach()?
>>
>> It is kind of explicit about the fact that it attaches the message to
>> existing buffer.
>>
>> Martin
>>
>
> I like attach, it's clear and obvious. Wrap I think is potentially
> confusing because of similar terminology around wrapping a message by adding
> a message part to the front of it, but I can't see a problem with attach.
>
> Ian
TBH, attach sounds like I could call it multiple times to add several
"attachments". It's similar to "add". What about a simple zmq_msg_set_data()
or zmq_msg_set_buffer() ?
Or just to have one function(zmq_msg_create or zmq_msg_init) with 3
different signatures:
zmq_msg_create(zmq_msg_t *msg); // zmq_msg_init();
zmq_msg_create(zmq_msg_t *msg, size_t size); // zmq_msg_init_size();
zmq_msg_create(zmq_msg_t *msg, size_t size, void *data, zmq_free_fn *ffn,
void *hint);
This way it would be much more clear that those functions are mutually
exclusive.
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110404/aba50649/attachment.htm>
More information about the zeromq-dev
mailing list