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

Martin Sustrik sustrik at 250bpm.com
Wed Sep 28 17:59:32 CEST 2011


On 09/28/2011 05:49 PM, Brad LaFountain wrote:

>   When i was looking into this problem, there is some good discussions
> about IOCP and 0mq almost seems like it would have been nice to have
> this on a wiki somewhere, because the topic keeps coming up and it took
> me awhile to find all of the posts.

The summary is pretty simple: It would be nice to have an IOCP polling 
mechanism supported the same way as select, poll, epoll, devpoll and 
kqueue are.

The fact that nobody was able to implement it so far indicates that it's 
actually not that easy.

>   I don't know the internals of 0mq very well, but from what i could
> tell (at the time) the thing that needed to be done is get the IOCP
> events and then push them to an inproc queue to be polled with the the
> normal way 0mq does, but i'm learning from some recent messages that
> inproc does some funny stuff with ports as well.

That's just a side effect of the silly way Windows APIs are designed. 
There's no socketpair() function so we have to simulate in-process pipe 
using a TCP connection. We can't use NamedPipes because the HANDLEs 
can't be polled on using select().

Martin



More information about the zeromq-dev mailing list