This commit is contained in:
suyl
2021-07-01 15:50:04 +08:00
parent 1697a85de6
commit 2ee949830a

View File

@@ -150,7 +150,6 @@ func connHandler(c net.Conn, printInfo *PrintInfo) (status int) {
defer c.Close() defer c.Close()
//缓冲 //缓冲
buf := make([]byte, 1024) buf := make([]byte, 1024)
for {
data, _ := json.Marshal(printInfo) data, _ := json.Marshal(printInfo)
//写入数据 //写入数据
c.Write(data) c.Write(data)
@@ -159,6 +158,5 @@ func connHandler(c net.Conn, printInfo *PrintInfo) (status int) {
status = utils.Str2Int(string(buf[:n])) status = utils.Str2Int(string(buf[:n]))
//服务器端回传的信息 //服务器端回传的信息
fmt.Println("server response:", string(buf[:n])) fmt.Println("server response:", string(buf[:n]))
}
return status return status
} }