<<I think this got dropped because of the size of the included replies>>

Is this correct?


Yes


> 1. What advantages do I have when using something like protocol buffer to
> serialization data instead of
> send the data of a basic way such as I perform here turn the data to
> string and sending it?
>

If you want to send complex data structures, portably between different
programming language environments and processor architectures.
This is not a goal of ZeroMQ and is explicitly left to other libraries and
tools.

| 2.  Why use memcpy is bad or not suited?

http://en.cppreference.com/w/cpp/algorithm/copy
http://en.cppreference.com/w/cpp/algorithm/copy_n

are better alternatives in C++ and as, or more efficient than ::memcpy
(they in fact delegate, as inline code to ::memcpy if that is the fastest
way to perform the copy).

your example would read -

#include <algorithm>

...

std::copy_n(result.c_str(), result.size() + 1, request.data());

OR

std::copy(result.begin(), result.size(), request.data());

On Wed, Jan 31, 2018 at 12:33 PM, Bernardo Augusto García Loaiza <
botib...@gmail.com> wrote:

> Hi Thomas, thanks for your appreciations
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to