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