Skip to content
Snippets Groups Projects
Commit 84b228cf authored by Sven-Ove Hänsel's avatar Sven-Ove Hänsel
Browse files

add keep alive

parent a3a49474
Branches
Tags
No related merge requests found
......@@ -261,7 +261,7 @@ client.on_connect = on_connect
client.on_message = on_message
client.failed_connect = False
client.connect(broker_hostname, broker_port)
client.connect(broker_hostname, broker_port,keepalive=3600*4)
client.loop_start()
# this try-finally block ensures that whenever we terminate the program earlier by hitting ctrl+c, it still gracefully exits
......
......@@ -261,7 +261,7 @@ client.on_connect = on_connect
client.on_message = on_message
client.failed_connect = False
client.connect(broker_hostname, broker_port)
client.connect(broker_hostname, broker_port,keepalive=3600*4)
client.loop_start()
# this try-finally block ensures that whenever we terminate the program earlier by hitting ctrl+c, it still gracefully exits
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment