modifié: superTornado.py
modifié: test.html
This commit is contained in:
parent
b5c1a76298
commit
d0370419e8
@ -108,8 +108,6 @@ class DisconnectionHandler(BaseHandler):
|
|||||||
class TestSocket(tornado.websocket.WebSocketHandler):
|
class TestSocket(tornado.websocket.WebSocketHandler):
|
||||||
def open(self) :
|
def open(self) :
|
||||||
print "->Websocket opened"
|
print "->Websocket opened"
|
||||||
|
|
||||||
def on_message(self,mesg):
|
|
||||||
print '->lol'
|
print '->lol'
|
||||||
try :
|
try :
|
||||||
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195')
|
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195')
|
||||||
@ -119,6 +117,9 @@ class TestSocket(tornado.websocket.WebSocketHandler):
|
|||||||
except Exception, e :
|
except Exception, e :
|
||||||
self.writemessage("")
|
self.writemessage("")
|
||||||
|
|
||||||
|
def on_message(self,mesg):
|
||||||
|
pass
|
||||||
|
|
||||||
def on_close(self):
|
def on_close(self):
|
||||||
print "->Websocket closed"
|
print "->Websocket closed"
|
||||||
|
|
||||||
|
@ -17,12 +17,6 @@
|
|||||||
ws.onclose = function () {
|
ws.onclose = function () {
|
||||||
console.log("connection closed");
|
console.log("connection closed");
|
||||||
};
|
};
|
||||||
/* function refresh() {*/
|
|
||||||
console.log("send data");
|
|
||||||
ws.send("next");
|
|
||||||
//}
|
|
||||||
/*$(document).ready(refresh())
|
|
||||||
setInterval(refresh(), 2000);*/
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
Reference in New Issue
Block a user