diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 084691c8d..bd7a2af0b 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -73,12 +73,12 @@ func (t *TcpClient) handleConn(c net.Conn) { globals.SugarLogger.Debugf("handleConn printno :[%v]", printNo) status := printStatus2JxStatus(data[len(data)-8 : len(data)-6]) //如果没在连接池里 - //1、加到连接池中,不同的打印机no开不同的go + //1、加到连接池中,不同的打印机no开不同的goroutine //2、初始化channel,每个打印机一个,放打印消息和打印回调消息 //3、读数据库里的待打印信息,放到打印channel中 //4、读打印channel并打印,并切等待回调channel中的消息 //5、修改数据库中打印机状态(没在连接池中说明是重新连接的) - //6、监听心跳时间,超过2分钟就clear掉 + //6、监听心跳时间,超过1分多钟就clear掉 globals.SugarLogger.Debugf("handleConn timeout channel...: %v", t.TimeoutMap[printNo]) if t.Clients[printNo] == nil { t.addConn(c, printNo, status) @@ -247,7 +247,8 @@ func (t *TcpClient) doPrint(key string) (err error) { a, b := getCallbackMsgInfo(dataStr) t.changePrintMsg(dataStr, a, b) //判断音频暂停? - //收到打印成功回调后,如果消息中有音频,需要等待一下 + //收到打印成功回调后,如果消息中有音频,需要等待一下,等上一个音频播完 + //暂停时间就暂时取的sound标签内内容长度/2 if sounds := regexpSoundSpan.FindStringSubmatch(printMsg.Content); len(sounds) > 0 { sound := sounds[1] lenTime := time.Duration(utf8.RuneCountInString(sound)) * time.Second