aa
This commit is contained in:
@@ -22,10 +22,7 @@ func ListenTcp() {
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("begin listenTcp port 8000......")
|
||||
//go t.HandleTcpMessages()
|
||||
go t.HandleCheckTcpHeart()
|
||||
//go t.doPrint2()
|
||||
//go t.doPrint(printMsgChanFail)
|
||||
for {
|
||||
c, err := l.Accept()
|
||||
if err != nil {
|
||||
@@ -90,7 +87,6 @@ func (t *TcpClient) handleConn(c net.Conn) {
|
||||
t.setPrintStatus(printNo, status)
|
||||
}
|
||||
globals.SugarLogger.Debugf("handleConn print model %v", utils.Format4Output(t.Clients[printNo], true))
|
||||
//}
|
||||
} else if strings.Contains(data, printText) {
|
||||
globals.SugarLogger.Debugf("handleConn print callback: %v", data)
|
||||
_, printNo = getCallbackMsgInfo(data)
|
||||
@@ -238,9 +234,7 @@ func (t *TcpClient) HandleCheckTcpHeart() {
|
||||
for _, v := range keys {
|
||||
changePrinterStatus(v, printerStatusOffline)
|
||||
if t.isExist(v) {
|
||||
t.Lock()
|
||||
delete(t.Clients, v)
|
||||
t.Unlock()
|
||||
t.clear(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user