aa
This commit is contained in:
@@ -232,14 +232,12 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
printMsg.Comment = err.Error()
|
printMsg.Comment = err.Error()
|
||||||
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
||||||
close(t.TimeoutMap[key])
|
close(t.TimeoutMap[key])
|
||||||
globals.SugarLogger.Debugf("handleTcpMessages clear1...")
|
|
||||||
} else {
|
} else {
|
||||||
if c != nil {
|
if c != nil {
|
||||||
if _, err = c.Write(data); err != nil {
|
if _, err = c.Write(data); err != nil {
|
||||||
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
||||||
//t.delConn(printMsg.PrintNo)
|
//t.delConn(printMsg.PrintNo)
|
||||||
close(t.TimeoutMap[key])
|
close(t.TimeoutMap[key])
|
||||||
globals.SugarLogger.Debugf("handleTcpMessages clear2...")
|
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
|
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
|
||||||
//等待回调
|
//等待回调
|
||||||
@@ -250,12 +248,13 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
close(t.MsgMap[key])
|
||||||
|
close(t.CallBackMap[key])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
close(t.MsgMap[key])
|
|
||||||
close(t.CallBackMap[key])
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,6 +274,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
|||||||
changePrinterStatus(key, printerStatusOffline)
|
changePrinterStatus(key, printerStatusOffline)
|
||||||
globals.SugarLogger.Debugf("HandleCheckTcpHeart clear...")
|
globals.SugarLogger.Debugf("HandleCheckTcpHeart clear...")
|
||||||
//t.clear(key)
|
//t.clear(key)
|
||||||
|
t.Clients[key].C.Close()
|
||||||
close(t.TimeoutMap[key])
|
close(t.TimeoutMap[key])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,5 +297,4 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
t.Clients[key].C.Close()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user