查打印机状态测试
This commit is contained in:
@@ -3,6 +3,7 @@ package cms
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"net"
|
||||
@@ -154,10 +155,10 @@ func connHandler(c net.Conn, printInfo *PrintInfo) (status int) {
|
||||
//写入数据
|
||||
c.Write(data)
|
||||
//服务器端返回的数据写入buf
|
||||
c.Read(buf)
|
||||
//status = buf[:]
|
||||
n, _ := c.Read(buf)
|
||||
status = utils.Str2Int(string(buf[:n]))
|
||||
//服务器端回传的信息
|
||||
//fmt.Println("server response:", string(buf[0:cnt]))
|
||||
fmt.Println("server response:", string(buf[:n]))
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user