s.bind((MY_TCP_IP, MY_TCP_PORT))
s.listen(1)
while True:
- time.sleep(1)
+ time.sleep(3)
conn, addr = s.accept()
if not conn: break
data = conn.recv(MY_BUFFER_SIZE)
'''
Launching the heartbeat function
'''
- p = Process(target=heartbeat, args=(False,))
- p.daemon = True
- p.start()
- heartbeat_pid = p.pid
+ hbp = Process(target=heartbeat, args=(False,))
+ hbp.daemon = True
+ hbp.start()
+ heartbeat_pid = hbp.pid
logger.info("heartbeat loop launched (pid " + str(heartbeat_pid) + ")")
'''
while True:
time.sleep(30)
except:
- logger.error("While loop interrupted : aborting")
+ logger.error("Main infinit while loop interrupted : aborting")
+ hbp.stop()
# Faut arrĂȘter les Process ...
# Invocation of the daemon part