Reworked for github.com/pebbe/zmq3