Sergei's solution works for my case too. But I didn't find any content about the REP socket type in the libzmq documentation, and they are using SUB socket in their code example. So is the documentation wrong?
REP
SUB