modifié: superTornado.py
This commit is contained in:
parent
93600edbec
commit
08212e08fd
@ -125,7 +125,7 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler):
|
|||||||
def send_image(self) :
|
def send_image(self) :
|
||||||
try :
|
try :
|
||||||
socket.setdefaulttimeout(5)
|
socket.setdefaulttimeout(5)
|
||||||
f = urlopen('http://test:a@192.168.1.13/image.jpg?cidx=791836195')
|
f = urlopen(urlCamera)
|
||||||
data = f.read()
|
data = f.read()
|
||||||
encoded = base64.b64encode(data)
|
encoded = base64.b64encode(data)
|
||||||
self.write_message(encoded)
|
self.write_message(encoded)
|
||||||
@ -175,12 +175,14 @@ if __name__ == "__main__":
|
|||||||
print ""
|
print ""
|
||||||
|
|
||||||
urlCamera = 'http://test:a@'+ipCamera+':'+portCamera+'/image.jpg?cidx=791836195'
|
urlCamera = 'http://test:a@'+ipCamera+':'+portCamera+'/image.jpg?cidx=791836195'
|
||||||
|
log.printL("->Ping camera ...",lvl.INFO)
|
||||||
try :
|
try :
|
||||||
|
socket.setdefaulttimeout(30)
|
||||||
f = urlopen(urlCamera)
|
f = urlopen(urlCamera)
|
||||||
log.printL( "->Camera OK ", lvl.SUCCESS)
|
log.printL( "->Camera OK ", lvl.SUCCESS)
|
||||||
except Exception, e :
|
except Exception, e :
|
||||||
log.printL("->Camera Unreachable! Check Camera Configuration!",lvl.FAIL)
|
log.printL("->WARNING : Camera Unreachable! Check Camera Configuration!",lvl.FAIL)
|
||||||
|
print ""
|
||||||
|
|
||||||
try :
|
try :
|
||||||
log.printL("->Server Start ...",lvl.INFO)
|
log.printL("->Server Start ...",lvl.INFO)
|
||||||
|
Reference in New Issue
Block a user