From: Ben Darnell Date: Sat, 29 May 2010 00:25:59 +0000 (-0700) Subject: Update documentation for WebSocketHandler X-Git-Tag: v1.0.0~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=548bd70d7ba3463331911225d33cfa8f706bdbd5;p=thirdparty%2Ftornado.git Update documentation for WebSocketHandler --- diff --git a/tornado/websocket.py b/tornado/websocket.py index dfca709c4..3c5223a5b 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -34,7 +34,10 @@ class WebSocketHandler(tornado.web.RequestHandler): self.receive_message(self.on_message) def on_message(self, message): - self.write_message(u"You said: " + message) + self.write_message(u"You said: " + message) + # receive_message only reads a single message, so call it + # again to listen for the next one + self.receive_message(self.on_message) Web Sockets are not standard HTTP connections. The "handshake" is HTTP, but after the handshake, the protocol is message-based. Consequently,