巫峡专栏

life is a huge undertaking

生活也是大事业

God helps those who help themselves

爱生活

爱技术

导航

2013年7月3日 #

[转] python 远程主机强迫关闭了一个现有的连接 socket 超时设置 errno 10054

摘要: python socket.error: [Errno 10054] 远程主机强迫关闭了一个现有的连接。问题解决方案:前几天使用python读取网页。因为对一个网站大量的使用urlopen操作,所以会被那个网站认定为攻击行为。有时就不再允许下载。导致urlopen()后,request.read()一直卡死在那里。最后会抛出errno 10054.这个错误是connection reset by peer.也就是传说的远端主机重置了此连接。原因可能是socket超时时间过长;也可能是request = urllib.request.urlopen(url)之后,没有进行request.clos 阅读全文

posted @ 2013-07-03 14:01 巫峡 阅读(4752) 评论(0) 推荐(0) 编辑