Skip to content
Snippets Groups Projects
Commit ef695e51 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

try catch when sending measurement

parent b1140b77
Branches
No related tags found
No related merge requests found
......@@ -59,9 +59,14 @@ def deploy_notif(ip_att):
HOST = "10.1.1.1"
PORT = 12344
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
try:
client.connect((HOST, PORT))
client.sendall(data_js.encode('utf-8')) # Send JSON data
client.close()
break
except Exception:
time.sleep(0.2)
e_queue_deploy_notif = if_utils.EventDrivenQueue(deploy_notif)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment