diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 89d5ac1bd..7d7dc7653 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -76,7 +76,6 @@ func (t *TcpClient) handleConn(c net.Conn) { globals.SugarLogger.Debugf("handleConn printno :[%v]", printNo) status := printStatus2JxStatus(data[len(data)-8 : len(data)-6]) if t.Clients[printNo] == nil { - timeoutChan <- 1 t.addConn(c, printNo, status) t.buildCallBackMap(printNo) t.buildMsgMap(printNo) @@ -219,7 +218,6 @@ func (t *TcpClient) doPrint(key string) (err error) { } } } - case <-timeoutChan: } } }() diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 867552742..f84b47bcf 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -241,8 +241,9 @@ func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) { func (t *TcpClient) addCallbackChan(key, data string) { t.Lock() defer t.Unlock() - if !t.isExistCallback(key) { - t.buildCallBackMap(key) + if t.CallBackMap[key] == nil { + dataChan := make(chan string, 1024) + t.CallBackMap[key] = dataChan } t.CallBackMap[key] <- data }