[zeromq-dev] Can't run tests concurrently due to hardcoded port numbers
Goswin von Brederlow
goswin-v-b at web.de
Tue Jul 29 12:08:16 CEST 2014
On Thu, Jul 24, 2014 at 02:27:41PM -0400, Greg Ward wrote:
> On 22 July 2014, Pieter Hintjens said:
> > Good catch. We could definitely use ephemeral ports (libzmq supports
> > that), though it would take changes to most of the test cases.
>
> OK, I'll open a bug. I'll see about starting on a patch too.
>
> > From
> > the zmq_tcp man page:
> >
> > ----
> > The TCP port number may be specified by:
> > · A numeric value, usually above 1024 on POSIX systems.
> > · The wild-card *, meaning a system-assigned ephemeral port.
> > When using ephemeral ports, the caller should retrieve the actual
> > assigned port using the ZMQ_LAST_ENDPOINT socket option. See
> > zmq_getsockopt(3) for details.
> > ----
>
> Sounds doable, but tedious. I predict I'll do 4 test cases before I
> wander off into factoring out the boring part. ;-)
>
> Thanks!
>
> Greg
Most tests create a socket pair so I guess it would make sense to have
a helper function
void *socks[2];
bool res = make_tcp_pair(socks, ZMQ_PUB, ZMQ_SUB);
assert(res);
MfG
Goswin
More information about the zeromq-dev
mailing list