[Lazarus] ZeroMQ Bindings

Paulo Costa paco.mail.telepac.pt at gmail.com
Wed Aug 24 02:58:41 CEST 2016


On 23-Aug-16 01:56, Leonardo M. Ramé wrote:
> Hi, I need to use ZeroMQ for inter process communication, but the
> bindings at https://github.com/bvarga/delphizmq does not seems to work,
> at least on Linux (XUbuntu 16.04 64bits) and zmq 4.2.

The bindings from bvarga work well with the version 3.2.5 and 32 bits.

The binding have some issues with 64bits. There are at least a few 
places where you must change integer to ptruint and there can be more 
subtle problems.

Another problem with version 4.x.x is that at some point they changed 
the zmq_msg_t structure definition.
The array inside grew from 32 bytes to 64 and they added an extra void 
pointer:

typedef union zmq_msg_t {unsigned char _ [64]; void *p; } zmq_msg_t;

in

https://github.com/zeromq/libzmq/blob/master/include/zmq.h

the bindings (https://github.com/bvarga/delphizmq/blob/master/zmq.pas) 
still have

type
   zmq_msg_t = record
     _: Array[0..32-1] of Byte;
   end;

which is the correct definition for version 3.2.5.


Paulo Costa


More information about the Lazarus mailing list