mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-26 19:48:34 +00:00
context (#28)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user