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