I'm attempting a small example on sending out a reliable multicast using zeromq 4.0.3 in Visual C++ but I'm getting an error connecting to the socket. The code snippet looks like this:

zmq::context_t context( 1 );

zmq::socket_t subscriber (context, ZMQ_SUB);
subscriber.connect( "epgm://244.0.0.1:5555" );
subscriber.setsockopt(ZMQ_SUBSCRIBE, "", 0);

Execution stops at the line with subscriber.connect( "epgm://244.0.0.1:5555" ) saying zmq::error_t at memory location 0x0114F734.

I'm fairly new to zeromq and network programming. There don't seem to be a great many multicasting examples using zeromq online, so I was just wondering if anybody has experienced a similar issue and found a solution or has any idea what direction I should search for the issue?

Thanks

P.S I included the zmq.hpp header file hence the zmq syntax you see.

有帮助吗?

解决方案

After much trial and error I found that the IP address I supplied to the connect function was invalid.

I looked online for a list of valid multicast address and then changed the IP address to one of the valid ones and that got rid of that error.

Thanks

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top