Skip to content
Snippets Groups Projects
Commit c9ef8c96 authored by root's avatar root
Browse files

Ajout du checker pour la surveillance

parent 02a46abb
Branches
No related merge requests found
......@@ -27,7 +27,7 @@ while True:
client, addr = server.accept()
#print("Client acceptee : ", addr)
log.write(str(datetime.now())+" => Client acceptee : "+addr+"\n")
log.write(str(datetime.now())+" => Client acceptee : "+str(addr)+"\n")
name = datetime.now().strftime("%d-%m-%Y_%H.%M.%S")
file = open("data/"+name, "wb")
......@@ -48,7 +48,8 @@ while True:
break
#print(" -> chunk")
except KeyboardInterrupt:
if file is not None:
file.close()
......@@ -59,7 +60,14 @@ while True:
log.write(str(datetime.now())+" ==> End Keyboard\n")
log.close()
sys.exit(0)
except OSError as ex:
log.write(str(datetime.now())+" ==> Exception "+str(type(ex))+" ("+str(ex.args)+")\n")
try :
server.close()
except:
pass
time.sleep(60)
except Exception as ex:
#print("Exception ", type(ex))
log.write(str(datetime.now())+" ==> Exception "+str(type(ex))+" ("+str(ex.args)+")\n")
......@@ -67,3 +75,5 @@ while True:
server.close()
except:
pass
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment