8000
Skip to content

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

@phoe

Description

@phoe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0