Skip to content
Advertisement

Tag: long-polling

Tornado gives error Cannot write() after finish()

I am using the Tornado chat demo example from here: https://github.com/tornadoweb/tornado/tree/master/demos/chat and just altering it very slightly. The code change is just a small class called Connections and a bit in the MessageNewHandler(). All I am doing is just saving a reference to self and trying to write(message) to a previous client. But when I go to save on this

Python http requests.exceptions.ConnectionError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’))

I’m writing a chat program. Each of my clients has an open get request to the server in a separate thread (and another thread for posting their own messages). I don’t want to have a lot of overhead. That is, clients don’t send get requests frequently to see if there have been any unseen messages. Instead, they always have exactly

Advertisement