calid/zmq-ffi — pull request #4 by klaus (2014-01-15 14:06:52+00:00)
Title: Compatibility for ZMQ4

Hi calid!

Thank you for providing ZMQ::FFI!

This integrates the libzmq4. In the course of implementing we found out that
FFI::Raw has a bug turning ptr to perl strings if the ptr length is 0 bytes
long.

This can be easily seen in a *standard* case of zmq when connecting to a
ROUTER socket. Messages to a router always have an identifier, an empty
message part and then the payload ( [ 'ident', '', 'payload' ] ).

I have added a workaround that might even speed up things in the ZMQ4::Socket.
We are also filing a Bug to FFI::Raw.

To prove the case, please run t/router-req.t against ZMQ3/Socket (which still
has the original code).

libzmq.so.4 is not created by zmq4 (read
http://lists.zeromq.org/pipermail/zeromq-dev/2014-January/024718.html for an
explanation) in case you might wonder why the code has not been updated.

Keep up the spirit!

lg,k