[zeromq-dev] [PATCH] Moved tests off 5555 (conflict with Eclipse)

Martin Lucina mato at kotelna.sk
Wed May 4 13:12:25 CEST 2011

ph at imatix.com said:
> On Fri, Apr 29, 2011 at 12:18 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> > The patch is OK. I was just asking whether something like port 45387 won't
> > be less contended than 5560.
> Well, for sure, but not significantly so. And there's a cost to longer
> random numbers (which is why people like ports like 5555, 6666, 7777,
> etc.)
> In realistic examples (and apps) we need a range of ports. We will
> eventually need some 'official' ports for things like 0MQ name
> services.
> I'm sure there are folk here with more experience in this domain.
> Let's see if anyone speaks up...

Whether you use 5555, 5560, 43587 or something else is irrelevant. There
will be someone, somewhere, who will have something sitting on that port
and "make check" will break for them.

Given that the tests are all "transient" programs where the actual port
number does not matter, a loop which tries say 100 times to bind to a
random high port is a hack but would work now.

This comes back to the funcionality several people are already emulating
and which I've been proposing to implement, but with no feedback from
Martin, which is built-in "bind to random port".

The idea is simple: For TCP endpoints on the bind side, allow something


to mean "bind to a free port".

The other piece of the puzzle is implementing getsockname() for all socket
types which then allows the application to get back a list of ports the
socket is bound to.


More information about the zeromq-dev mailing list