On Fri, Oct 26, 2012 at 8:22 PM, Stephen Lord <[email protected]> wrote:

> What I had to work out for myself by reading source code was that
> this works:
>     ret = zmq_bind(sock, "tcp://*:*");

This isn't documented in the zmq_bind man page. It should be...

>     ret = zmq_getsockopt(sock, ZMQ_LAST_ENDPOINT, endpoint, &optlen);

Right, as the zmq_getsockopt page says, if you bind to all interfaces
you'll get back an address 0.0.0.0. You can bind to specific IP
addresses. You can also use getifaddrs to discover all interfaces and
bind to each one: This might be worth doing inside libzmq
automatically instead of using INADDR_ANY.

-Pieter
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to