Commit b0c8ec91 authored by aurel's avatar aurel

mqtt client reconnect

parent cf6f8a39
......@@ -56,6 +56,10 @@ class GameState:
GAMEEND = "gameend"
def reconnectMqtt(client, userdata, rc):
client.connect(PongConfig.mqttHost, 1883, 60)
class PongGame:
def __init__(self):
......@@ -91,7 +95,7 @@ class PongGame:
if PongConfig.doMqtt:
self.mqttClient = mqtt.Client()
self.mqttClient.connect(PongConfig.mqttHost, 1883, 60)
self.mqttClient.on_disconnect = reconnectMqtt
def setupControllers(self, numControllers=2):
......
Markdown is supported
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