From 9255fa9d24087402859a7a93eb3a4c25e96c9fec Mon Sep 17 00:00:00 2001 From: rickyes Date: Thu, 28 May 2020 23:15:55 +0800 Subject: [PATCH 01/13] http: add maxTotalSockets to agent class --- doc/api/http.md | 10 +++ lib/_http_agent.js | 74 ++++++++++++++++--- .../test-http-agent-maxtotalsockets.js | 65 ++++++++++++++++ 3 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 test/parallel/test-http-agent-maxtotalsockets.js diff --git a/doc/api/http.md b/doc/api/http.md index 357d8b16928d47..ad3c09df23073a 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -300,6 +300,16 @@ added: v0.3.6 By default set to `Infinity`. Determines how many concurrent sockets the agent can have open per origin. Origin is the returned value of [`agent.getName()`][]. +### `agent.maxTotalSockets` + + +* {number} + +By default set to `undefined`. Determines how many concurrent sockets the agent +can have open. The `maxSockets` will not take effect when this parameter is set. + ### `agent.requests`