我基于 sockjs-tornado 聊天示例开发了即时消息应用程序。我的代码是异步的。
有这个堆栈跟踪:
ERROR:root:Exception in callback <tornado.stack_context._StackContextWrapper object at 0x80932c788>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/tornado/ioloop.py", line 421, in _run_callback
callback()
File "/usr/local/lib/python2.7/site-packages/tornado/iostream.py", line 305, in wrapper
callback(*args)
File "/usr/local/lib/python2.7/site-packages/sockjs/tornado/websocket.py", line 661, in _on_frame_data
self._receive_frame()
File "/usr/local/lib/python2.7/site-packages/sockjs/tornado/websocket.py", line 580, in _receive_frame
self.stream.read_bytes(2, self._on_frame_start)
File "/usr/local/lib/python2.7/site-packages/tornado/iostream.py", line 166, in read_bytes
self._try_inline_read()
File "/usr/local/lib/python2.7/site-packages/tornado/iostream.py", line 382, in _try_inline_read
self._check_closed()
File "/usr/local/lib/python2.7/site-packages/tornado/iostream.py", line 565, in _check_closed
raise IOError("Stream is closed")
IOError: Stream is closed
如果我必须从聊天参与者列表中删除对已关闭连接的引用,如何处理此异常?
谢谢