add clientID in log for debug
This commit is contained in:
1 parent
208a7cf0a8
commit
6a89b627d4
2 files changed
+21
-32
No files matched your search
+4
-3
@@ -253,7 +253,7 @@ func (b *Broker) handleConnection(typ int, conn net.Conn, idx uint64) {
|
||||
connack.SessionPresent = msg.CleanSession
|
||||
err = connack.Write(conn)
|
||||
if err != nil {
|
||||
log.Error("send connack error, ", err)
|
||||
log.Error("send connack error, ", err, " clientID = ", msg.ClientIdentifier)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -295,10 +295,11 @@ func (b *Broker) handleConnection(typ int, conn net.Conn, idx uint64) {
|
||||
c.mp = msgPool
|
||||
old, exist = b.clients.Load(cid)
|
||||
if exist {
|
||||
log.Warn("client exist, close old...")
|
||||
log.Warn("client exist, close old...", " clientID = ", c.info.clientID)
|
||||
ol, ok := old.(*client)
|
||||
if ok {
|
||||
ol.Close()
|
||||
msg := &Message{client: c, packet: DisconnectdPacket}
|
||||
ol.mp.queue <- msg
|
||||
}
|
||||
}
|
||||
b.clients.Store(cid, c)
|
||||
|
||||
Reference in new issue
Block a user