From 86f037a855ed3b402bef89b7c934835f5b126023 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Fri, 28 Feb 2014 07:43:20 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20supe?= =?UTF-8?q?rTornado.py=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20video.?= =?UTF-8?q?html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superTornado.py | 4 ++-- video.html | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superTornado.py b/superTornado.py index 6778d6b..8d18676 100644 --- a/superTornado.py +++ b/superTornado.py @@ -95,9 +95,9 @@ class DisconnectionHandler(BaseHandler): class WSocketHandler(tornado.websocket.WebSocketHandler): def open(self) : - """if not self.current_user : + if not self.current_user : self.close() - return""" + return print "->Websocket opened" while 1 : try : diff --git a/video.html b/video.html index 1aeaf39..a8268f3 100644 --- a/video.html +++ b/video.html @@ -18,6 +18,10 @@ ws.onclose = function () { console.log("connection closed"); }; + + window.onunload=function(){ + ws.close(); + };