This commit is contained in:
suyl
2021-08-02 14:45:10 +08:00
parent f35d9d69ed
commit 051539f936

View File

@@ -43,7 +43,7 @@ func (t *TcpClient) handleConn(c net.Conn) {
}
defer c.Close()
buffer := make([]byte, 1024)
for {
//for {
n, err := c.Read(buffer)
if err != nil {
if err == io.EOF {
@@ -59,7 +59,7 @@ func (t *TcpClient) handleConn(c net.Conn) {
if printStatus != nil {
status := t.getPrintStatus(printStatus.PrintNo)
c.Write([]byte(utils.Int2Str(status)))
break
c.Close()
}
}
//看是心跳还是打印返回
@@ -93,7 +93,7 @@ func (t *TcpClient) handleConn(c net.Conn) {
_, printNo = getCallbackMsgInfo(data)
t.addCallbackChan(printNo, data)
}
}
//}
}
func (t *TcpClient) printFail() (err error) {