1
This commit is contained in:
@@ -56,16 +56,15 @@ func (t *TcpClient) handleConn(c net.Conn) {
|
||||
|
||||
//看是心跳还是打印回调
|
||||
data := hex.EncodeToString(buffer[:n])
|
||||
if strings.Contains(string(buffer[0:n]), "print_no") { // 清理缓存
|
||||
globals.SugarLogger.Debugf("=========buffer %s", string(buffer[0:n]))
|
||||
if strings.Contains(string(buffer[0:n]), "print_no_clear") { // 清理缓存
|
||||
param := struct {
|
||||
PrintNo json.Number `json:"print_no"`
|
||||
PrintNoClear json.Number `json:"print_no_clear"`
|
||||
}{}
|
||||
if err := json.Unmarshal(buffer[0:n], ¶m); err != nil {
|
||||
c.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
t.buildMsgMap(param.PrintNo.String())
|
||||
t.buildMsgMap(param.PrintNoClear.String())
|
||||
c.Write([]byte("ok"))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user