套接字在发出多个http post请求时挂断

时间:2022-10-11 23:53:33

I am reading a csv file and I am extracting data and making a post request every 30 seconds(setTimeout help) with data extracted with request module, after making 3 requests it shows this error

我正在读取一个csv文件,我正在提取数据并每隔30秒发出一次发布请求(setTimeout帮助),并使用请求模块提取数据,在发出3个请求后显示此错误

Error: socket hang up
 at createHangUpError (_http_client.js:200:15)
 at Socket.socketOnEnd (_http_client.js:292:23)
 at emitNone (events.js:72:20)
 at Socket.emit (events.js:166:7)
 at endReadableNT (_stream_readable.js:913:12)
 at nextTickCallbackWith2Args (node.js:442:9)
 at process._tickCallback (node.js:356:17)

1 个解决方案

#1


0  

Depending on your implementation there could be multiple things that could cause this.

根据您的实现,可能会有多种因素导致此问题。

I would use something like Async Parallel for these kind of tasks. Give it a try.

我会使用像Async Parallel这样的任务来完成这些任务。试试看。

#1


0  

Depending on your implementation there could be multiple things that could cause this.

根据您的实现,可能会有多种因素导致此问题。

I would use something like Async Parallel for these kind of tasks. Give it a try.

我会使用像Async Parallel这样的任务来完成这些任务。试试看。