문제

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