Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #177 from Countly/agent-destroy
Browse files Browse the repository at this point in the history
Adding Agent.destroy as in node http(s) module
  • Loading branch information
nwgh committed Apr 21, 2016
2 parents 427e60c + f0b9a5e commit 247c214
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/http.js
Expand Up @@ -1009,6 +1009,15 @@ Agent.prototype.get = function get(options, callback) {
return request;
};

Agent.prototype.destroy = function(error) {
if (this._httpsAgent) {
this._httpsAgent.destroy();
}
for (var key in this.endpoints) {
this.endpoints[key].close(error);
}
};

function unbundleSocket(socket) {
socket.removeAllListeners('data');
socket.removeAllListeners('end');
Expand Down

0 comments on commit 247c214

Please sign in to comment.