1
This commit is contained in:
@@ -96,6 +96,7 @@ func handleConn(c net.Conn) error {
|
|||||||
_, printNo = getCallbackMsgInfo(data)
|
_, printNo = getCallbackMsgInfo(data)
|
||||||
callback = true
|
callback = true
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("printNoData------: %s", printNo)
|
||||||
|
|
||||||
if value, have := TcpClientList.Load(printNo); !have {
|
if value, have := TcpClientList.Load(printNo); !have {
|
||||||
t = NewTcpClient()
|
t = NewTcpClient()
|
||||||
|
|||||||
@@ -747,22 +747,22 @@ func doPrint(t *TcpClient, key string) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 链接已经关闭了
|
// 链接已经关闭了
|
||||||
if isClosed(c) {
|
//if isClosed(c) {
|
||||||
remoteAddr := c.RemoteAddr().(*net.TCPAddr)
|
// remoteAddr := c.RemoteAddr().(*net.TCPAddr)
|
||||||
remoteIP := remoteAddr.IP.String() // 打印机IP
|
// remoteIP := remoteAddr.IP.String() // 打印机IP
|
||||||
remotePort := remoteAddr.Port // 打印机端口
|
// remotePort := remoteAddr.Port // 打印机端口
|
||||||
globals.SugarLogger.Debugf("remoteIP3: %s", remoteIP)
|
// globals.SugarLogger.Debugf("remoteIP3: %s", remoteIP)
|
||||||
globals.SugarLogger.Debugf("remotePort3: %d", remotePort)
|
// globals.SugarLogger.Debugf("remotePort3: %d", remotePort)
|
||||||
|
//
|
||||||
printRemoteAddr := c.RemoteAddr().String()
|
// printRemoteAddr := c.RemoteAddr().String()
|
||||||
printRemoteAddr = strings.Split(printRemoteAddr, ":")[0]
|
// printRemoteAddr = strings.Split(printRemoteAddr, ":")[0]
|
||||||
globals.SugarLogger.Debugf("printRemoteAddr3: %s", printRemoteAddr)
|
// globals.SugarLogger.Debugf("printRemoteAddr3: %s", printRemoteAddr)
|
||||||
|
//
|
||||||
c = reconnectPrinter(c)
|
// c = reconnectPrinter(c)
|
||||||
if c != nil {
|
// if c != nil {
|
||||||
t.setPrintConn(printMsg.PrintNo, c)
|
// t.setPrintConn(printMsg.PrintNo, c)
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
if _, err = c.Write(data); err != nil {
|
if _, err = c.Write(data); err != nil {
|
||||||
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user