Frame.opCall_data
Initializes a $(ZMQ) message frame from a supplied buffer.
Warning:
Some care must be taken when using this function, as $(ZMQ) expects
to take full ownership of the supplied buffer. Client code should
therefore avoid retaining any references to it, including slices that
contain, overlap with or are contained in data.
$(ZMQ) makes no guarantee that the buffer is not modified,
and it does not specify when the buffer is released.
An additional complication is caused by the fact that most arrays in D
are owned by the garbage collector. This is solved by adding the array
pointer as a new garbage collector root before passing it to
$(ZMQREF zmq_msg_init_data()), thus preventing the GC from collecting
it. The root is then removed again in the deallocator callback
function which is called by $(ZMQ) when it no longer requires
the buffer, thus allowing the GC to collect it.
Frame.opCall_data Initializes a $(ZMQ) message frame from a supplied buffer.
Warning: Some care must be taken when using this function, as $(ZMQ) expects to take full ownership of the supplied buffer. Client code should therefore avoid retaining any references to it, including slices that contain, overlap with or are contained in data. $(ZMQ) makes no guarantee that the buffer is not modified, and it does not specify when the buffer is released.
An additional complication is caused by the fact that most arrays in D are owned by the garbage collector. This is solved by adding the array pointer as a new garbage collector root before passing it to $(ZMQREF zmq_msg_init_data()), thus preventing the GC from collecting it. The root is then removed again in the deallocator callback function which is called by $(ZMQ) when it no longer requires the buffer, thus allowing the GC to collect it.