python socket 编程,sftp远程读日志文件,取最后的30行返回。收到ConnectionResetError: [Errno 104] Connection reset by peer报错。
最后找到原因是send的数据size太大,服务器端重置了连接

Traceback (most recent call last):
  File "s1.py", line 63, in <module>
    data = tcpCliSock.recv(bufsize).decode()
ConnectionResetError: [Errno 104] Connection reset by peer

解决办法:把异常by pass

from socket import error as SocketError
import errno

try:
     ...

...
except SocketError as e:
    if e.errno != errno.ECONNRESET:
        raise
    pass



[Python] ConnectionResetError: [Errno 104] Connection reset by peer相关推荐

  1. ConnectionResetError: [Errno 104] Connection reset by peer

    Python代码使用循环发起网络请求,发起单个没有问题,发起多个请求,就会报错 ConnectionResetError: [Errno 104] Connection reset by peer 可 ...

  2. (20200921 Solved)ConnectionResetError: [Errno 104] Connection reset by peer

    问题描述 用Python连接docker容器中的Redis 预备知识 [Errno 104] Connection reset by peer errno 104表示对一个对端socket已经关闭的连 ...

  3. python httplib [Errno 104] Connection reset by peer问题

    写了一个简单的http client 方法,代码如下 import httplib import json from common.logger import sys_loggerdef http_r ...

  4. python [Errno socket error] [Errno 104] Connection reset by peer

    python [Errno socket error] [Errno 104] Connection reset by peer 原因可能是多方面的,不过更常见的原因是: ①:服务器的并发连接数超过了 ...

  5. <urlopen error [Errno 104] Connection reset by peer>

    使用python写一个脚本调用接口时,报了这个错,在"urllib.request.urlopen(req, context=context)"这个方法中报错. 错误原因 发送的r ...

  6. socket或pipe 一端断开; errno 104:connetction reset by peer的错误分析

    errno 104:connetction reset by peer的错误分析 https://blog.csdn.net/alibo2008/article/details/45694845 er ...

  7. nginx php 104,记一次nginx 502排错经历:recv() failed (104: Connection reset by peer)

    开发了一个新项目,开发环境完全正常,部署至测试环境时,直接报502,换了几台测试机器,有正常的也有依然报502的-- 环境 开发.测试.生产环境均是CentOS 6.8的系统,Web环境是nginx+ ...

  8. nginx php 104,Nginx错误:recv() failed (104: Connection reset by peer) whi

    Nginx错误:recv() failed (104: Connection reset by peer) while reading response header from upstream PH ...

  9. recv() failed (104: Connection reset by peer) while reading response header from upstream

    场景:为了得到用户在线等实时信息,在客户端做了个ajax轮训,每隔5秒请求一次: 用户量一上来,于是问题就来了,页面各种卡nginx日志文件 [root@iZt web]# tail -f /data ...

最新文章

  1. Python高级编程(二)
  2. C语言从0到1·数据类型及其存储
  3. vue 如何解析原生html,VUE渲染后端返回含有script标签的html字符串示例
  4. matlab基本运算实验报告,实验2 Matlab的基本运算实验报告
  5. 记录一个海思TOE的BUG
  6. Markdown编辑器模板
  7. 【数学】奶牛编号(jzoj 2932)
  8. termcap-1.3.1的configure.in文件逐行分析
  9. squid 出错页面GMT时间修改(FreeBSD)
  10. Atitit 深入了解UUID含义是通用唯一识别码 (Universally Unique Identifier),
  11. java比较两个对象_Java比较两个对象
  12. 直流双闭环调速系统的计算机仿真,基于MATLAB的双闭环直流调速系统仿真研究
  13. 【清华大学陈渝】第一章 操作系统概述
  14. python 桌面应用 h5_hdf 5文件格式及python中利用h5py模块读写h5文件
  15. 齐齐哈尔2021高考成绩查询,2021齐齐哈尔市地区高考成绩排名查询,齐齐哈尔市高考各高中成绩喜报榜单...
  16. mfs网络分布式文件系统、高可用、iscsi存储方式的mfs、fence
  17. linux dd创建大文件模拟磁盘不足监控
  18. 跨境知道快讯:亚马逊推出“Buy with Prime”服务
  19. Python之父:Python 4.0可能不会有了
  20. 计算机与艺术联姻阶段,数字媒体艺术概论

热门文章

  1. 神舟电脑学校电脑硬件知识第二章
  2. php发送exmail邮箱,WordPress无插件完美实现邮箱SMTP发件功能
  3. 50个新的游戏玩法机制
  4. 太突然!多所百年高校永久关闭!这个行业将损失超1700亿元...
  5. python编写程序、输出公元2000年到3000年所有闰年_编写程序,输出从公元2000年至3000年所有闰年的年号,每输出10个年号换一行.判断公元年是否为闰年的条件...
  6. android arrayadapter自定义,android – 如何向Arrayadapter添加自定义布局?
  7. DelayedOperationPurgatory机制(七):DelayedFetch实现
  8. python之封包 (转)
  9. 索尼ST18i刷机包 源于官方 感知流畅 深度精简 极度省电 稳定版上市
  10. 17组漫画卡通字体推荐给设计师