title: ZMQ: "Resource temporarily unavailable" when connecting zmq socket
body: <p>I'm attempting to use libzmq (4.2.2) via czmqz (4.0.2) to establish an IPC communication channel between a Python program and my C++ application. </p>
  
  <p>I'm using the ZMQ publisher/subscriber pattern, where the Python program binds to a port and publishes messages using pyzmq (16.0.2), and my C++ program uses the <a href="http://czmq.zeromq.org/manual:zsock" rel="nofollow noreferrer">zsock class</a> from CZMQ to connect as a subscriber.</p>
  
  <p>The problem is, whenever my subscriber attempts to connect, I get back error code 11, <em>Resource temporarily unavailable</em>. Strangely, <strong>this system seems to work just fine on my development machine</strong>, but not on the target system I'm deploying to.</p>
  
  <p>The problem occurs on the very first line of initializing the socket in the following abridged method:</p>
  
  <pre><code>bool ZmqSocketWrapper::connectSubscriber(string address)
  {
      m_address = address;
      m_pSocket = zsock_new_sub(address.c_str(), "");
  
      int errorCode = zmq_errno();
      if (errorCode != 0)
      {
          printf(zmq_strerror(errorCode));
          return false;
      }
  
      return true;
  }
  </code></pre>
  
  <p>This is called as follows:</p>
  
  <pre><code>m_subscriberSocket-&gt;connectSubscriber("tcp://127.0.0.1:5555");
  </code></pre>
  
  <p>And I've also tried other variations, with the same result:</p>
  
  <pre><code>m_subscriberSocket-&gt;connectSubscriber("tcp://localhost:23232");
  m_subscriberSocket-&gt;connectSubscriber("ipc:///tmp/test");
  </code></pre>
  
  <p>When searching online, it appears that most other people have this problem when attempting to send/receive, so it seems odd that I'm having this when just attempting to open the socket.</p>
  
  <p>A few other details:</p>
  
  <ul>
  <li>My ZMQ publisher is written in Python using pyzmq and is working fine <em>on the same target system</em>, which suggests that the problem is in czmq.</li>
  <li>The machine where I'm seeing the problem is a Raspberry Pi, in case that's relevant, although bear in mind the point above.</li>
  <li>No, nothing else is using that port, and I've confirmed using netstat that the server port is listening.</li>
  <li>Yes, I've tried running my client as root.</li>
  </ul>
  
  <p>Any help much appreciated!</p>