aa
This commit is contained in:
@@ -56,7 +56,7 @@ func ListenTcp() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("begin listenTcp port 8000......")
|
globals.SugarLogger.Debugf("begin listenTcp port 8000......")
|
||||||
//go HandleTcpMessages()
|
go HandleTcpMessages()
|
||||||
for {
|
for {
|
||||||
c, err := l.Accept()
|
c, err := l.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -173,6 +173,7 @@ func HandleTcpMessages() {
|
|||||||
printMsg.Comment = err.Error()
|
printMsg.Comment = err.Error()
|
||||||
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
||||||
delete(tcpClient.Clients, printMsg.PrintNo)
|
delete(tcpClient.Clients, printMsg.PrintNo)
|
||||||
|
c.Close()
|
||||||
} else {
|
} else {
|
||||||
if c != nil {
|
if c != nil {
|
||||||
if _, err = c.Write(data); err != nil {
|
if _, err = c.Write(data); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user