[zeromq-dev] Binding to TCP port 0

Pieter Hintjens ph at imatix.com
Thu Jan 26 19:41:36 CET 2012

On Thu, Jan 26, 2012 at 8:57 AM, Martin Lucina <martin at lucina.net> wrote:

> This leaves us with something like this proposal:
> => endpoint is filled as "tcp://XXXX:12345".

Missed this. It won't work. Bind interfaces are not the same as
connect addresses. The caller needs to know the port number, it can
then reconstruct a full address and broadcast that to peers, e.g. via
a central broker or out-of-band UDP (we do this in several
applications using CZMQ). Returning the bound interface + port just
creates extra parsing work for applications.

Further, you need to support "*" in the bind address, just treat ":*"
at the end as special. Otherwise you break the very common and
necessary use case of "bind to all interfaces".


More information about the zeromq-dev mailing list