-
Notifications
You must be signed in to change notification settings - Fork 11
Description
The macro WITH-MESSAGE does not allow me to create a message from a predefined buffer or with a predefined size. Effectively, it only allows me to create empty messages.
From http://api.zeromq.org/4-2:zmq-msg-init-data:
The functions zmq_msg_init(), zmq_msg_init_data() and zmq_msg_init_size() are mutually exclusive. Never initialise the same zmq_msg_t twice.
Currently each binding inside WITH-MESSAGE and WITH-MESSAGES must be a symbol naming the message. A possible change would be a possibility to have lists as bindings, of form (name &key size data) that allow the user to specify the expected message size or the data from which ZMQ should construct the message. An additional key for The latter option is impossible since ZMQ automatically disposes of buffers after sending messages.data would be free-p which specifies whether the buffer should be freed after use; this might be convenient if the buffer does not need to be freed afterwards, for instance, when it is a pointer to a Lisp object accessed via cffi:with-pointer-to-vector-data.