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。