django an established connection was aborted by the software in you host machine


Exception happened during processing of request from ('127.0.0.1', 52690)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\site-packages\django-1.4-py2.7.egg\django\core\servers\basehttp.py", line 139, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\SocketServer.py", line 641, in __init__
    self.finish()
  File "C:\Python27\lib\SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "C:\Python27\lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 10053] An established connection was aborted by the software in your host machine

 上面的异常总是在我刷新页面或者重新select serverType的时候出现,这样意味着可能刚才在排队执行的ajax请求在没有接收数据之前抛弃了链接,也就是“ajax发了请求,但是转开了,不再接收数据了。。。。”  然后在客户端就弹出了一个没有任何提示信息的弹出框。。。。

 

http://dadekey.blog.51cto.com/107327/23605  这篇文章《windows错误代码解析》 里提到10053错误:

WSAECONNABORTED (10053) Software caused connection abort.

一个已建立的连接被你的主机上的软件终止,可能是因为一次数据传输超时或是协议错误。

  每次页面刷新,然后就传输数据超时?或者说页面停留太久,请求太过于频繁?就abort connect了?

 

问题:页面上频繁的setTimeout定时请求,然后每次页面在切换走的时候,那些个setTimeout留下的残余ID,没有被清除掉。

解决方案: 为window绑定beforeunload事件,清除所有残留的setTimeout的ID。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM