aa
This commit is contained in:
@@ -196,6 +196,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-t.TimeoutMap[key]:
|
case <-t.TimeoutMap[key]:
|
||||||
|
close(t.MsgMap[key])
|
||||||
|
close(t.CallBackMap[key])
|
||||||
globals.SugarLogger.Debugf("doPrint timeout")
|
globals.SugarLogger.Debugf("doPrint timeout")
|
||||||
return
|
return
|
||||||
default:
|
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 {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-t.TimeoutMap[key]:
|
case <-t.TimeoutMap[key]:
|
||||||
|
t.Clients[key].C.Close()
|
||||||
globals.SugarLogger.Debugf("HandleCheckTcpHeart timeout")
|
globals.SugarLogger.Debugf("HandleCheckTcpHeart timeout")
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
@@ -274,7 +274,6 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
|||||||
changePrinterStatus(key, printerStatusOffline)
|
changePrinterStatus(key, printerStatusOffline)
|
||||||
globals.SugarLogger.Debugf("HandleCheckTcpHeart clear...")
|
globals.SugarLogger.Debugf("HandleCheckTcpHeart clear...")
|
||||||
//t.clear(key)
|
//t.clear(key)
|
||||||
t.Clients[key].C.Close()
|
|
||||||
close(t.TimeoutMap[key])
|
close(t.TimeoutMap[key])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user