mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-26 11:38:33 +00:00
disconnect
This commit is contained in:
@@ -467,13 +467,19 @@ func (c *client) ProcessPing() {
|
||||
}
|
||||
|
||||
func (c *client) Close() {
|
||||
if c.status == Disconnected {
|
||||
return
|
||||
}
|
||||
|
||||
c.smu.Lock()
|
||||
c.status = Disconnected
|
||||
c.smu.Unlock()
|
||||
|
||||
if c.conn != nil {
|
||||
c.conn.Close()
|
||||
c.conn = nil
|
||||
}
|
||||
c.smu.Unlock()
|
||||
|
||||
b := c.broker
|
||||
subs := c.subs
|
||||
if b != nil {
|
||||
|
||||
Reference in New Issue
Block a user