[zeromq-dev] [PATCH] Moved tests off 5555 (conflict with Eclipse)
ph at imatix.com
Wed May 4 16:16:14 CEST 2011
On Wed, May 4, 2011 at 4:03 PM, Martin Lucina <mato at kotelna.sk> wrote:
> On the other hand, if the idiom is supported by libzmq then it can pass
> a port of 0 directly to bind(2), which results in the OS allocating you a
> free port. However, this requires a getsockname() API of some kind to get
> the allocated port number.
Very true. You could get the port number via a getsockopt, no?
Having this in libzmq would be ideal. But I doubt it'll ever get into
2.x, and at least a start would be to have a common abstraction for
language bindings. We can always implement that "natively" afterwards.
IMO looking for a random free port above 10K would work well and not be fragile.
More information about the zeromq-dev