From 593716ee26ffd5d00115a5756e448251cc6dbb85 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Thu, 1 Jul 2021 14:59:08 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 25da67456..7d44de595 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -2,6 +2,7 @@ package event import ( "encoding/hex" + "encoding/json" "fmt" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" @@ -134,7 +135,8 @@ func ListenTcp() { func handleConn(c net.Conn) { var ( - printNo string //打印机编号 + printNo string //打印机编号 + printMsg *PrintInfo ) if c == nil { globals.SugarLogger.Debugf("conn is nil") @@ -153,7 +155,7 @@ func handleConn(c net.Conn) { return } //也可能是查状态的 - + json.Unmarshal(buffer[:n], &printMsg) //看是心跳还是打印返回 data := hex.EncodeToString(buffer[:n]) //证明是心跳