zeromq/zproto — pull request #147 by hintjens (2014-11-08 12:34:07+00:00)
Title: Massive breaking changes for C server/codec

Sorry about this. The old codec was doing way too much heap allocation. This is part of a general wave of performance improvements.

The old codec is in zproto_codec_c_v1.gsl if you still want it. The server stack (and soon the client) will use the new lighter codec. I'll update CZMQ, Zyre, Malamute, etc. to work with this.

* self->request and self->reply are now replaced by the single property self->message. Note the new format of _client_t:

struct _client_t {
// These properties must always be present in the client_t
// and are set by the generated engine; do not modify them!
server_t *server; // Reference to parent server
$(proto)_t *message; // Message in and out

// TODO: Add specific properties for your application
};

* These methods are gone from the v2 codec, so no longer available to your zproto_server apps:

_decode
_encode
_recv_nowait
_send_again
_encode_xxx
_send_xxx
_dup

* The codec constructor for the new codec does not take an ID, you set this explicitly using _set_id.

* The codec _recv method does NOT return a new object instance. It receives into an existing instance.

* The codec _send method does NOT destroy the object instance. It leaves it as-is and you can send N times.