title: Huge delay from ping test with socket.io in nodejs
body: <p>I am experiencing consistent delay of 25 seconds when running this simple ping test. The server is not logging the ping event but I am assuming it is receiving it because the client is getting a reply. Any ideas on how to fix this?</p>
  
  <p>client</p>
  
  <pre><code>    var io = require('socket.io-client')('http://68.12.157.176:3000')
      var ping_time = Date.now();
  
      function ping(){
        ping_time = Date.now();
        console.log('sending ping...');
        io.emit('ping');
      }
      ping();
  
      io.on('pong', function (data) {
        ping_time = Date.now() - ping_time;
        console.log("replied in " + ping_time + "ms");
        ping();
      });
  </code></pre>
  
  <p>client log</p>
  
  <pre><code>    sending ping...
      replied in 25202ms
      sending ping...
      replied in 25028ms
      sending ping...
      replied in 25029ms
      sending ping...
      replied in 25032ms
      sending ping...
      replied in 25016ms
  </code></pre>
  
  <p>server</p>
  
  <pre><code>    var express = require('express');
      var app = express();
      var server = require('http').createServer(app);
      var io = require('../..')(server);
      var port = process.env.PORT || 3000;
  
      server.listen(port, function () {
        console.log('Server listening at port %d', port);
      });
  
      io.on('connection', function (socket) {
        console.log('client connected');
        socket.on('ping', function (data) {
          console.log("received ping, sending reply"); //no log shown???
          socket.emit('pong'); //client receives event ~25 seconds after request
        });
      });
  </code></pre>
  
  <p>server log</p>
  
  <pre><code>    Server listening at port 3000
      client connected
  </code></pre>