当前位置:网站首页>mysql econnreset_Nodejs 套接字报错处理 Error: read ECONNRESET
mysql econnreset_Nodejs 套接字报错处理 Error: read ECONNRESET
2022-07-05 12:51:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
错误信息:
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:162:27)
出现上述情况一般是客户端关闭了socket连接导致的错误,这个错误会导致程序的异常退出
解决办法:
var pReq = http.request(options, function (pRes) {
cSock.writeHead(pRes.statusCode, pRes.headers);
pRes.pipe(cSock);
}).on(‘connect’, (res, socket, head) => {
const { httpVersion, statusCode, statusMessage } = res;
cSock.write(`HTTP/{httpVersion} {statusCode}
cSock.pipe(socket);
socket.pipe(cSock);
socket.on(‘error’,(e)=>{
console.log(‘====>’,e.stack)
socket.destroy()
})
cSock.on(‘error’,(e)=>{
console.log(‘====>’,e.stack)
})
cSock.on(‘close’,()=>{
console.log(‘close===========’)
cSock.destroy()
})
}).on(‘error’, function (e) {
console.error(`请求遇到问题: ${e.message}`);
});
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/149592.html原文链接:https://javaforall.cn
边栏推荐
- Four common problems of e-commerce sellers' refund and cash return, with solutions
- 初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
- SAP UI5 FlexibleColumnLayout 控件介绍
- 将函数放在模块中
- 谈谈我写作生涯的画图技巧
- Transactions from January 14 to 19, 2022
- Association modeling method in SAP segw transaction code
- MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
- SAP SEGW 事物码里的 Association 建模方式
- Laravel文档阅读笔记-mews/captcha的使用(验证码功能)
猜你喜欢
Developers, is cloud native database the future?
How to protect user privacy without password authentication?
Taobao flag insertion remarks | logistics delivery interface
关于 SAP UI5 floating footer 显示与否的单步调试以及使用 SAP UI5 的收益
Introduction to sap ui5 flexiblecolumnlayout control
Principle and configuration of RSTP protocol
SAP UI5 DynamicPage 控件介绍
将函数放在模块中
你的下一台电脑何必是电脑,探索不一样的远程操作
函数传递参数小案例
随机推荐
Association modeling method in SAP segw transaction code
A deep long article on the simplification and acceleration of join operation
DNS的原理介绍
RHCSA8
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
#yyds干货盘点# 解决名企真题:搬圆桌
RHCAS6
我在滴滴做开源
Taobao order amount check error, avoid capital loss API
Transactions from December 29, 2021 to January 4, 2022
I'm doing open source in Didi
mysql拆分字符串做条件查询
ABAP editor in SAP segw transaction code
Hiengine: comparable to the local cloud native memory database engine
简单上手的页面请求和解析案例
将函数放在模块中
RHCSA10
From the perspective of technology and risk control, it is analyzed that wechat Alipay restricts the remote collection of personal collection code
Developers, is cloud native database the future?
JXL notes