modifié: superTornado.py

This commit is contained in:
sidya82 2014-02-28 07:02:04 +01:00
parent be49ff44ca
commit 3f07e89851

View File

@ -111,16 +111,16 @@ class TestSocket(tornado.websocket.WebSocketHandler):
print "->Websocket opened" print "->Websocket opened"
print '->lol' print '->lol'
#while 1 : #while 1 :
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')
data = f.read() data = f.read()
encoded = base64.b64encode(data) encoded = base64.b64encode(data)
self.write_message(encoded) self.write_message(encoded)
except tornado.websocket.WebSocketClosedError: except tornado.websocket.WebSocketClosedError:
break break
else : else :
self.write_message(" ") self.write_message(" ")
time.sleep(2) time.sleep(2)
def on_message(self,mesg): def on_message(self,mesg):
pass pass