To use the scheme epgm:// or pgm:// you must configure libzmq 3.x (HEAD) using the --with-pgm.
./configure --with-pgm
./make
./make install
Remember to set you LD_LIBRARY_PATH to the location of the libzmq installation parameter For bash:
export LD_LIBRARY_PATH=/usr/local/lib
To compile publisher.c and subscriber.c
gcc -lzmq -lczmq -o publisher publisher.c
gcc -lzmq -lczmq -o subscriber subscriber.c
Thanks for the examples. A couple of suggestions for improvement:
while
loop to avoid CPU getting hogged and network getting flooded e.g.zclock_sleep (1000);
printf
. I got more consistent output by creating char* usingzframe_strdup
and passing that toprintf
e.g.