This commit is contained in:
suyl
2021-07-22 11:32:46 +08:00
parent 1dd3d024ac
commit 688710fb1c
2 changed files with 6 additions and 3 deletions

View File

@@ -142,10 +142,7 @@ func ListenTcp() {
return
}
globals.SugarLogger.Debugf("begin listenTcp port 8000......")
go HandleTcpMessages()
go HandleCheckTcpHeart()
//go doPrint(printMsgChanFail)
go doPrint2(printMsgChan)
for {
c, err := l.Accept()
if err != nil {
@@ -155,6 +152,11 @@ func ListenTcp() {
go handleConn(c)
}
}
func Run() {
go HandleTcpMessages()
go HandleCheckTcpHeart()
go doPrint2(printMsgChan)
}
func handleConn(c net.Conn) {
var (

View File

@@ -129,6 +129,7 @@ func main() {
}
}()
if globals.IsPrintEnv() {
event.Run()
event.ListenTcp()
}
beego.Run()