##// END OF EJS Templates
handle message arriving when sockets are closed...
Min RK -
Show More
@@ -111,7 +111,6 b' class ZMQStreamHandler(WebSocketHandler):'
111 111 """Check Origin == Host or Access-Control-Allow-Origin.
112 112
113 113 Tornado >= 4 calls this method automatically, raising 403 if it returns False.
114 We call it explicitly in `open` on Tornado < 4.
115 114 """
116 115 if self.allow_origin == '*':
117 116 return True
@@ -173,7 +172,10 b' class ZMQStreamHandler(WebSocketHandler):'
173 172 def _on_zmq_reply(self, stream, msg_list):
174 173 # Sometimes this gets triggered when the on_close method is scheduled in the
175 174 # eventloop but hasn't been called.
176 if stream.closed(): return
175 if self.stream.closed() or stream.closed():
176 self.log.warn("zmq message arrived on closed channel")
177 self.close()
178 return
177 179 channel = getattr(stream, 'channel', None)
178 180 try:
179 181 msg = self._reserialize_reply(msg_list, channel=channel)
General Comments 0
You need to be logged in to leave comments. Login now