Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WITH-MESSAGE does not allow me to initialize a message with size or data #20

Open
phoe opened this issue May 24, 2019 · 0 comments
Open

Comments

@phoe
Copy link
Contributor

phoe commented May 24, 2019

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 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. The latter option is impossible since ZMQ automatically disposes of buffers after sending messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant