aa
This commit is contained in:
@@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user