Skip to content

Commit

Permalink
fix: set maxSockets defautl value to Number.MAX_SAFE_INTEGER (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolme200 authored and fengmk2 committed May 27, 2017
1 parent 5b6fe2b commit 35fa5a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ module.exports = appInfo => {
* @property {Boolean} keepAlive - Enable http keepalive or not, default is true
* @property {Number} freeSocketKeepAliveTimeout - socket keepalive max free time, default is 4000 ms.
* @property {Number} timeout - socket max unative time, default is 30000 ms.
* @property {Number} maxSockets - max socket number of one host, default is Infinity.
* @property {Number} maxSockets - max socket number of one host, default is `Number.MAX_SAFE_INTEGER` @ses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
* @property {Number} maxFreeSockets - max free socket number of one host, default is 256.
* @property {Boolean} enableDNSCache - Enable DNS lookup from local cache or not, default is false.
*/
config.httpclient = {
keepAlive: true,
freeSocketKeepAliveTimeout: 4000,
timeout: 30000,
maxSockets: Infinity,
maxSockets: Number.MAX_SAFE_INTEGER,
maxFreeSockets: 256,
enableDNSCache: false,
dnsCacheMaxLength: 1000,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/core/httpclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ exports.httpclient = {
// 当 socket 超过 30 秒都没有任何活动,就会被当作超时处理掉
timeout: 30000,
// 允许创建的最大 socket 数
maxSockets: Infinity,
maxSockets: Number.MAX_SAFE_INTEGER,
// 最大空闲 socket 数
maxFreeSockets: 256,
// 是否开启本地 DNS 缓存,默认关闭,开启后有两个特性
Expand Down

0 comments on commit 35fa5a9

Please sign in to comment.