This commit is contained in:
suyl
2021-06-29 10:27:34 +08:00
parent a1851188ad
commit b1b4d34eca

View File

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