From: Roger Light Date: Tue, 31 Dec 2013 22:37:18 +0000 (+0000) Subject: Use loop_forever() in example. X-Git-Tag: v0.9~31 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=4e9aae30f48c01c193b94ae9772a48461048b43f;p=packages%2Fp%2Fpaho-mqtt.git Use loop_forever() in example. --- diff --git a/examples/sub.py b/examples/sub.py index 81900d5..0b121eb 100755 --- a/examples/sub.py +++ b/examples/sub.py @@ -61,8 +61,5 @@ mqttc.connect("m2m.eclipse.org", 1883, 60) mqttc.subscribe("$SYS/#", 0) -rc = 0 -while rc == 0: - rc = mqttc.loop() +mqttc.loop_forever() -print("rc: "+str(rc))