a
This commit is contained in:
@@ -94,8 +94,8 @@ func (t *TcpClient) handleConn(c net.Conn) {
|
|||||||
//t.Clients[printNo] = printInfo
|
//t.Clients[printNo] = printInfo
|
||||||
//t.Unlock()
|
//t.Unlock()
|
||||||
t.addConn(c, printNo, status)
|
t.addConn(c, printNo, status)
|
||||||
t.buildCallBackMap(printNo)
|
//t.buildCallBackMap(printNo)
|
||||||
t.buildMsgMap(printNo)
|
//t.buildMsgMap(printNo)
|
||||||
go t.doPrint2(printNo)
|
go t.doPrint2(printNo)
|
||||||
changePrinterStatus(printNo, status)
|
changePrinterStatus(printNo, status)
|
||||||
if status == printerStatusOnline {
|
if status == printerStatusOnline {
|
||||||
|
|||||||
@@ -219,8 +219,8 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
|
func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
|
||||||
t.RLock()
|
t.Lock()
|
||||||
defer t.RUnlock()
|
defer t.Unlock()
|
||||||
if !t.isExistMsg(printMsg.PrintNo) {
|
if !t.isExistMsg(printMsg.PrintNo) {
|
||||||
t.buildMsgMap(printMsg.PrintNo)
|
t.buildMsgMap(printMsg.PrintNo)
|
||||||
}
|
}
|
||||||
@@ -228,8 +228,8 @@ func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *TcpClient) addCallbackChan(key, data string) {
|
func (t *TcpClient) addCallbackChan(key, data string) {
|
||||||
t.RLock()
|
t.Lock()
|
||||||
defer t.RUnlock()
|
defer t.Unlock()
|
||||||
if !t.isExistCallback(key) {
|
if !t.isExistCallback(key) {
|
||||||
t.buildCallBackMap(key)
|
t.buildCallBackMap(key)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user