[zeromq-dev] epgm example

Roberto Palmer roberto.palmer at gmail.com
Mon Oct 10 17:57:33 CEST 2011


Hello all,
I have a problem while trying to make a simple example with epgm.
I wrote the following simple C program, but it makes a core dump
with the following error:

	Assertion failed: rc == 0 (connect_session.cpp:84).
	Aborted (core dumped)

I'm using zmq 2.1.10 with F15. 

What I'm missing ?
Thanks for any help.

R.



#include <string.h>
#include <assert.h>

#include <zmq.h>


int
main(int argc, char** argv)
{
        void *ctx;
        void *s;
        zmq_msg_t msg;
        int rc;


        ctx = zmq_init (1);
        assert(ctx);

        s = zmq_socket(ctx, ZMQ_PUB);

        rc = zmq_connect(s, "epgm://239.192.1.1:5555");
        assert (rc == 0);

        rc = zmq_msg_init_size (&msg, 4);
        assert (rc == 0);

        memset(zmq_msg_data (&msg), 'A', 4);

        rc = zmq_send(s, &msg, 0);
        assert (rc == 0);

        zmq_msg_close(&msg);
        assert (rc == 0);

        sleep(3);
        return 0;
}




More information about the zeromq-dev mailing list