test print
This commit is contained in:
@@ -157,8 +157,14 @@ func handleConn(c net.Conn) {
|
||||
}
|
||||
//也可能是查状态的
|
||||
if err = json.Unmarshal(buffer[:n], &printStatus); err == nil {
|
||||
fmt.Println("handleConn msg: %v", buffer[:n])
|
||||
if printStatus != nil {
|
||||
status := tcpClient.Clients[printStatus.PrintNo].Status
|
||||
var status int
|
||||
if tcpClient.Clients[printStatus.PrintNo] != nil {
|
||||
status = tcpClient.Clients[printStatus.PrintNo].Status
|
||||
} else {
|
||||
status = printerStatusOffline
|
||||
}
|
||||
c.Write([]byte(utils.Int2Str(status)))
|
||||
c.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user