From bb8d2b6f04f2519255d8894dcc367ca32952762d Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 9 Feb 2016 18:27:17 -0700 Subject: [PATCH] This is now fixed in the Paho client, setting timeout to 60s Why 60s? This is the timeout I've generally seen used by MQTT client UIs. --- subscribe.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/subscribe.go b/subscribe.go index 0849014..38e4cec 100644 --- a/subscribe.go +++ b/subscribe.go @@ -15,12 +15,7 @@ func subscribe(c *cli.Context) { log.Error(err) os.Exit(1) } - - // Setting KeepAlive to 0 disables it. Paho MQTT client is currently broken - // and does not send ping when subscribing only. - // TODO set KeepAlive to a real value (60s?) when this change is merged: - // https://git.eclipse.org/r/#/c/65850/ - opts.SetKeepAlive(time.Duration(0)) + opts.SetKeepAlive(time.Second * 60) if c.Bool("c") { clientId := c.String("i")