This commit is contained in:
suyl
2021-08-03 15:25:21 +08:00
parent 5a2bb4aacd
commit eeddcf214e

View File

@@ -196,6 +196,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
for {
select {
case <-t.TimeoutMap[key]:
close(t.MsgMap[key])
close(t.CallBackMap[key])
globals.SugarLogger.Debugf("doPrint timeout")
return
default:
@@ -248,9 +250,6 @@ func (t *TcpClient) doPrint(key string) (err error) {
}
}
}
default:
close(t.MsgMap[key])
close(t.CallBackMap[key])
}
}
}
@@ -265,6 +264,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
for {
select {
case <-t.TimeoutMap[key]:
t.Clients[key].C.Close()
globals.SugarLogger.Debugf("HandleCheckTcpHeart timeout")
return
default:
@@ -274,7 +274,6 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
changePrinterStatus(key, printerStatusOffline)
globals.SugarLogger.Debugf("HandleCheckTcpHeart clear...")
//t.clear(key)
t.Clients[key].C.Close()
close(t.TimeoutMap[key])
}
}