Created
May 3, 2013 17:06
-
-
Save tisba/5511388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var _ = require("underscore") | |
, ForeverAgent = require("request/forever"); | |
exports.createKeepAliveAgent = function createKeepAliveAgent() { | |
var agent = new ForeverAgent(); | |
agent.close = function close() { | |
var self = this; | |
_.each(self.sockets, function (value, key) { | |
self.sockets[key].forEach(function (socket) { | |
socket.destroy(); | |
}); | |
}); | |
}; | |
agent.minSockets = 1000; | |
return agent; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment