title: cppzmq fails to receive tcp messages
body: <p>I am trying to use ZMQ socket on my Ubuntu machine to communicate with a ESP8266 edge device. I tried this piece of Python code which works fine:</p>
  <pre class="lang-py prettyprint-override"><code>import zmq
  
  ctx = zmq.Context()
  
  router = ctx.socket(zmq.ROUTER)
  router.router_raw = True
  
  router.bind(&quot;tcp://*:8081&quot;)
  
  while True:
      msg = router.recv_multipart()
      identity, body = msg
  
      print(identity)
      print(body)
  </code></pre>
  <p>as it gives (server side)</p>
  <pre class="lang-sh prettyprint-override"><code>b'\x00k\x8bEg'
  b''
  b'\x00k\x8bEg'
  b'hello from ESP8266'
  b'\x00k\x8bEg'
  b'\r\n'
  </code></pre>
  <p>but when I translate it into C++ as</p>
  <pre class="lang-cpp prettyprint-override"><code>
  #include &lt;zmq_addon.hpp&gt;
  
  int main () {
      zmq::context_t context;
      zmq::socket_t socket(context, zmq::socket_type::router);
      int router_raw = 1;
      zmq_setsockopt(&amp;socket, ZMQ_ROUTER_RAW, &amp;router_raw, 1);
      socket.bind(&quot;tcp://*:8081&quot;);
  
      while (true) {
          std::cout &lt;&lt; &quot;listening &quot; &lt;&lt; std::endl;
          std::vector&lt;zmq::message_t&gt; msgs;
  
           if (zmq::recv_multipart(socket, std::back_inserter(msgs))) {
              std::cout &lt;&lt; &quot;got &quot; &lt;&lt; static_cast&lt;const char *&gt; (msgs.front().data())
                  &lt;&lt; std::endl;
           }
      }
      return 0;
  }
  </code></pre>
  <p>it doesn't work any more and hangs before <code>recv_multipart</code>, though at the same time ESP8266 client do recieve some wierd <code>⸮</code> symbol which indicates tcp connection success I guess.</p>