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

View File

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