2

I'm trying to multicast using zmq on Linux. My program dies on the line that tries to bind to the epgm address.

I ran the exact same code in VC++ while i was running the client and server both on the same host and it ran fine. However from what i've read by other programmers on this site, zmq does not support loopback functionality so I can't do publishes and receive the messages on the same host using epgm.

I moved the program to a linux box and I received an error. Here are the code and the error, do you know by any chance if this error has to do with me using an invalid IP for Linux?

zmq::context_t context( 1 );
zmq::socket_t publisher( context, ZMQ_PUB );

publisher.bind( "epgm://224.0.0.1:5555" );

Error line is the bind line.

Error is:

terminate called after throwing an instance of 'zmq::error_t'
what():  Protocol not supported

Thanks for the help

SilverBackApe
  • 227
  • 4
  • 15

1 Answers1

1

I found the solution to this problem.

Apparently when you intend on using zmq for multicasts (pgm or epgm) you have to run the ./configure with pgm enabled then do a make after.

For this libpgm is required

In looking through my extracted tar zmq tar file under the folder /foreign/ there is a libpgm tar file.

So i just ran:

./configure --with-pgm=libpgm-5.2.122~dfsg

make

sudo make install

This solved the problem and i am able to bind using epgm now.

(obviously the version of libpgm will be the version in your zmq folder)

SilverBackApe
  • 227
  • 4
  • 15