[zeromq-dev] epgm example

Steven McCoy steven.mccoy at miru.hk
Mon Oct 10 18:31:53 CEST 2011


On 10 October 2011 11:57, Roberto Palmer <roberto.palmer at gmail.com> wrote:

> 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)
>

Looks like the infamously vague error handling problems interpreting the
network parameter:


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

The network parameter here does not specify the interface and it is likely
the system is presenting multiple options and cannot decide between them.
 Solution is to explicitly define the interface to use.  You have a choice
between hostname, IP address, network address, or network name, for example:

       rc = zmq_connect(s, "epgm://eth0;239.192.1.1:5555");
>

Would likely fail if you have IPv6 enabled too.

       rc = zmq_connect(s, "epgm://192.168.1.1;239.192.1.1:5555");
>

More explicit.  To have some abstraction you can use DNS or the NSS naming
system for networks.  The NSS subsystem does not support IPv6 and so OpenPGM
provides an internal implementation if necessary.

       rc = zmq_connect(s, "epgm://myhostname-eth0;239.192.1.1:5555");
       rc = zmq_connect(s, "epgm://mynetwork;239.192.1.1:5555");

/etc/hosts
  192.168.1.1       myhostname-eth0

/etc/networks:
  mynetwork         192.168.1


Alternative compatibility NSS:

/tmp/mynetworks:
  mynetwork         192.168.1

PGM_NETDB=/tmp/networks ./myØMQapp ...

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111010/83307716/attachment.htm>


More information about the zeromq-dev mailing list