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