aa
This commit is contained in:
@@ -82,6 +82,8 @@ func (t *TcpClient) handleConn(c net.Conn) {
|
|||||||
}
|
}
|
||||||
changePrinterStatus(printNo, status)
|
changePrinterStatus(printNo, status)
|
||||||
t.HandleCheckTcpHeart(printNo)
|
t.HandleCheckTcpHeart(printNo)
|
||||||
|
} else {
|
||||||
|
t.setPrintStatusTime(printNo)
|
||||||
}
|
}
|
||||||
if t.getPrintStatus(printNo) != status {
|
if t.getPrintStatus(printNo) != status {
|
||||||
t.setPrintStatus(printNo, status)
|
t.setPrintStatus(printNo, status)
|
||||||
|
|||||||
@@ -229,6 +229,15 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
|
|||||||
defer t.Unlock()
|
defer t.Unlock()
|
||||||
if t.Clients[key] != nil {
|
if t.Clients[key] != nil {
|
||||||
t.Clients[key].Status = status
|
t.Clients[key].Status = status
|
||||||
|
//t.Clients[key].StatusTime = time.Now()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *TcpClient) setPrintStatusTime(key string) {
|
||||||
|
t.Lock()
|
||||||
|
defer t.Unlock()
|
||||||
|
if t.Clients[key] != nil {
|
||||||
|
//t.Clients[key].Status = status
|
||||||
t.Clients[key].StatusTime = time.Now()
|
t.Clients[key].StatusTime = time.Now()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user