It has cost me a significant amount of loss of hair and sleep, but I think this should do the trick: https://github.com/zeromq/libzmq/pull/1511