code: function Agent(options) {
    var self = this;
    self.options = options || {};
    self.requests = {};
  
    self.sockets = {};
    self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets;
    self.keepAliveTimeout = self.options.keepAliveTimeout || 10*1000;
    self.maxRequestPerConnection  = self.options.maxRequestPerConnection || 1000;
  
    self.on('free', function(socket, host, port) {
  
      var name = host + ':' + port;
      var sn = self.requests[name];
      if (sn && sn.length) {
        var req = sn.shift();
        bindReqSocket(req, socket);
        if (sn.length === 0) {
          // don't leak
          delete self.requests[name];
        }
      } else {
        // If there are no pending requests just destroy the
        // socket and it will get removed from the pool. This
        // gets us out of timeout issues and allows us to
        // default to Connection:keep-alive.
        if((sn && sn.length >= self.maxSockets) || 
          (socket._reqCount >= self.maxRequestPerConnection)){
  
          socket.destroy();
        } else {
          //restart keepavlive timeout
          socket._used = false;
          timers.enroll(socket._kpTimer, self.keepAliveTimeout);
          timers.active(socket._kpTimer);
        }
      }
    });
  
    self.createConnection = net.createConnection;
  }
docs: setInterval(function(){ print('total request count : ' + gReqCount); print('total socket  count : ' + gSocketCount); }, 10000);