Hi Pierre!

On Wed, 25 Jan 2012 18:22:55 +0100
Pierre Ynard <[email protected]> wrote:

> > If you're using the high level C binding this works. It's not a core
> > libzmq functionality. Some other bindings may also provide it.
> > 
> > You can check the CZMQ code that does this:
> > https://github.com/zeromq/czmq/blob/master/src/zsocket.c
> 
> Thanks, but I don't really want to write an ugly for loop to (badly)
> reinvent a feature of the socket API. Also this code ignores the OS
> settings for local port assignation.

+1, I have proposed this functionality before, but we could not figure
out a way to make the API work. Its obvious that many people need
this, and have implemented it with the same hack as czmq.
 
> Why is it disabled in libzmq?

It is disabled because in ZeroMQ, by design, there is no way to work
with individual underlying connections of a socket. Hence, there is no
API equivalent to e.g. getsockname() which you could use to get the port
back from the OS.

If you can think of a way to make this work, without exposing the
details of the individual connections to the application, and
without a backward-incompatible API change, please propose it (or
even better, make a patch).

-mato
-- 
Martin Lucina <[email protected]>
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to