gpt4 book ai didi

node.js - nodejs TLSSocket.onHangUp

转载 作者:搜寻专家 更新时间:2023-11-01 00:05:55 26 4
gpt4 key购买 nike

我有 2 个通过 HTTPS 通信的 nodejs 模块。

在极少数情况下,对服务器模块的请求之一返回:

堆栈跟踪

Error: socket hang up
at TLSSocket.onHangUp (_tls_wrap.js:1049:19)
at TLSSocket.g (events.js:260:16)
at emitNone (events.js:72:20)
at TLSSocket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:913:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickDomainCallback (node.js:397:17)

将错误号设置为 ECONNRESET

为什么会发生这样的事情?

我已经检查过:

  1. 服务器在响应前崩溃
  2. 服务器响应时间过长
  3. 证书已过期。

此外,服务器日志没有显示任何类型的问题。

谢谢

最佳答案

ECONNRESET (Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via the http and net modules.

常见系统错误”:https://nodejs.org/api/errors.html

所以先试试看会发生什么

process.on("uncaughtException", function (err) {
console.log('err uncaught Exception : ', err);
})

关于node.js - nodejs TLSSocket.onHangUp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40228074/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com