[zeromq-dev] ZMQ occupies random TCP ports on Windows

Michał Sznajder michalsznajder at gmail.com
Wed Sep 28 11:41:11 CEST 2011

Hi Martin,

On Wed, Sep 28, 2011 at 8:30 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:
>> Unfortunately ZMQ opens arbitrary TCP ports on Windows in order to
>> simulate socketpair(3) functionality [1] that is used by some kind of
>> signalling mechanism(?). As a result sometimes application port gets
>> occupied by another instance and my application fails to start.
> Yes. This is a serious problem.

For us it is a stopper. I would not use ZMQ at all if I would knew
that earlier...

> The silly thing is that it uses new destination port for each of those
> connections.
> Possible solution is to use a single fixed port for all these internal
> connections...

I tried to convert a Windows pipe into C++ runtime handle with
_open_osfhandle() but select() will not accept such conversion.

Is fixing this port really an option? I got a feeling that mailbox_t
is used quite interdependently in many places of code for different


More information about the zeromq-dev mailing list