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