[zeromq-dev] [zyre] Can not get UDP beaconing working

Arnaud Loonstra arnaud at sphaero.org
Wed Aug 27 11:13:27 CEST 2014


On 08/27/2014 07:44 AM, Stanislav Ivochkin wrote:
> Hi all!
>
> I've wrote a simple program to play with zyre, but it does not work as I
> expect.
>
> #include <thread>
> #include <zyre.h>
>
> int main(int argc, char* argv[])
> {
>    auto node = zyre_new(nullptr);
>    auto rc = zyre_start(node);
>
>    auto spammer = std::thread([node]() {
>      while (true) {
>        zyre_dump(node);
>        sleep(1);
>      }
>    });
>
>    sleep(10000); // wait for termination signal in original
>    zyre_stop(node);
>    zyre_destroy(&node);
>    spammer.join();
> }
>
> Having two instances of the program running I always see "peers: 0"
> line. Does it mean that instances do not see each other?
>
> Could you please guide me how to use zyre correctly.
>
> I am using
> - ubuntu 14.04 x86_64 gcc 4.8.2
> - libsodium 0.7.0 f241744e4dfd1529b309402cd59a7e5a3a5b4f73
> - libzmq master 81485c7688a19cb947f77aad7765a2de59f10eb5
> - czmq master c0bb78891b149f106845be87d221a5fca5c0c4bb
> - zyre master f98749d0b5d9404b0f9ff4310845c705413214d0
>
> Should I switch to more stable versions? What combination would you suggest?
>
> --
> Regards,
>
> Stas.

I'd suggest you start with the example chat. See if that works for you.

https://github.com/zeromq/zyre/tree/master/examples/chat

Rg,

Arnaud

-- 
w: http://www.sphaero.org
t: http://twitter.com/sphaero
g: http://github.com/sphaero
i: freenode: sphaero_z25



More information about the zeromq-dev mailing list