This commit is contained in:
joy.zhou
2018-05-10 13:13:36 +08:00
committed by GitHub
parent 684584b208
commit 84e7fe2490
2 changed files with 40 additions and 37 deletions

View File

@@ -4,10 +4,11 @@ package broker
import (
"fmt"
"time"
simplejson "github.com/bitly/go-simplejson"
"github.com/eclipse/paho.mqtt.golang/packets"
"go.uber.org/zap"
"time"
)
func (c *client) SendInfo() {
@@ -35,10 +36,8 @@ func (c *client) StartPing() {
log.Error("ping error: ", zap.Error(err))
c.Close()
}
case _, ok := <-c.closed:
if !ok {
return
}
case <-c.ctx.Done():
return
}
}
}