This commit is contained in:
suyl
2021-08-03 15:39:38 +08:00
parent eeddcf214e
commit 8de2b13d5f

View File

@@ -196,14 +196,13 @@ 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:
select {
case printMsg, ok := <-t.MsgMap[key]:
if !ok {
globals.SugarLogger.Debugf("doPrint err !ok ...")
return
}
var (
@@ -265,6 +264,8 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
select {
case <-t.TimeoutMap[key]:
t.Clients[key].C.Close()
close(t.MsgMap[key])
close(t.CallBackMap[key])
globals.SugarLogger.Debugf("HandleCheckTcpHeart timeout")
return
default: