当前位置:网站首页>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
边栏推荐
- Shi Zhenzhen's 2021 summary and 2022 outlook | colorful eggs at the end of the article
- There is no monitoring and no operation and maintenance. The following is the commonly used script monitoring in monitoring
- Rocky基础知识1
- 自然语言处理从小白到精通(四):用机器学习做中文邮件内容分类
- 深度长文探讨Join运算的简化和提速
- STM32 and motor development (from architecture diagram to documentation)
- HiEngine:可媲美本地的云原生内存数据库引擎
- Get to know linkerd project for the first time
- #yyds干货盘点# 解决名企真题:搬圆桌
- A deep long article on the simplification and acceleration of join operation
猜你喜欢

初识Linkerd项目

Pycharm installation third party library diagram

国内市场上的BI软件,到底有啥区别

MySQL 巨坑:update 更新慎用影响行数做判断!!!

RHCSA1
![leetcode:221. Maximum square [essence of DP state transition]](/img/ea/158e8659657984794c52a0449e0ee5.png)
leetcode:221. Maximum square [essence of DP state transition]

Taobao, pinduoduo, jd.com, Doudian order & Flag insertion remarks API solution

Vonedao solves the problem of organizational development effectiveness

太方便了,钉钉上就可完成代码发布审批啦!

Lepton 无损压缩原理及性能分析
随机推荐
Four common problems of e-commerce sellers' refund and cash return, with solutions
[cloud native] event publishing and subscription in Nacos -- observer mode
JXL notes
RHCSA2
SAP UI5 FlexibleColumnLayout 控件介绍
A deep long article on the simplification and acceleration of join operation
Transactions from December 29, 2021 to January 4, 2022
SAP ui5 objectpagelayout control usage sharing
潘多拉 IOT 开发板学习(HAL 库)—— 实验7 窗口看门狗实验(学习笔记)
946. 验证栈序列
Vonedao solves the problem of organizational development effectiveness
A small talk caused by the increase of sweeping
太方便了,钉钉上就可完成代码发布审批啦!
leetcode:221. Maximum square [essence of DP state transition]
函数的默认参数&函数参数的多种方法
Small case of function transfer parameters
关于 SAP UI5 floating footer 显示与否的单步调试以及使用 SAP UI5 的收益
Setting up sqli lab environment
由扫地增而引起的小叙
解决 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 107