title: ZMQ subscriber does not receive message from remote server after long interval
body: <p>The following pubsub php works normally when the both php are running in the same server. However, it does not work when they are running in the different servers.</p>
  
  <pre><code>(local)client.php &lt;--&gt; (local)server.php (with sleeptime 300) &lt;= OK
  (local)client.php &lt;--&gt; (remote)server.php (with sleeptime 300) &lt;= NG
  </code></pre>
  
  <p>I changed the sleep time from 300 to 30. It worked. </p>
  
  <pre><code>(local)client.php &lt;--&gt; (remote)server.php (with sleeptime 30) &lt;= OK
  </code></pre>
  
  <p>I think that the socket was closed or something happened during only remote access. How can I fix it? I want to detect the closed socket and re-connect. Or I want to change the time-out setting if it is possible.</p>
  
  <p><strong>server.php</strong></p>
  
  <pre><code>&lt;?php
  $context = new ZMQContext();
  $publisher = new ZMQSocket($context, ZMQ::SOCKET_PUB);
  $publisher-&gt;bind("tcp://*:5563");
  
  while (true) {
      sleep (300);
      $publisher-&gt;send("A", ZMQ::MODE_SNDMORE);
      $publisher-&gt;send("We don't want to see this");
      $publisher-&gt;send("B", ZMQ::MODE_SNDMORE);
      $publisher-&gt;send("We would like to see this");
  }
  </code></pre>
  
  <p><strong>client.php</strong></p>
  
  <pre><code>&lt;?php
  
  $context = new ZMQContext();
  $subscriber = new ZMQSocket($context, ZMQ::SOCKET_SUB);
  $subscriber-&gt;connect("tcp://localhost:5563"); // This is the setting for local server.php. I changed it for server.php at remote.php 
  $subscriber-&gt;setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, "B");
  
  while (true) {
      $address = $subscriber-&gt;recv();
      $contents = $subscriber-&gt;recv();
      printf ("[%s] %s%s", $address, $contents, PHP_EOL);
  </code></pre>
  
  <p>I'm using libzmq, php-zmq. ZMQ::LIBZMQ_VER is 4.2.1. PHP is version 5.</p>
  
  <p>I'm not sure but server setting ( ubuntu16 LTS ) can be a possible reason.</p>