This commit is contained in:
aozhiwei 2023-08-12 15:57:11 +08:00
parent c0b745e42c
commit 1b28b28a3e
3 changed files with 11 additions and 11 deletions

View File

@ -130,7 +130,7 @@ func (this *WSPListener_) parseNetPkt() {
hdr.Msg = cs.ParsePb(hdr.MsgId, hdr.Data)
if hdr.Msg != nil {
hdr.Entry.Init(hdr)
App.addNetMsg(hdr)
app.addNetMsg(hdr)
}
}
}

View File

@ -11,16 +11,16 @@ import (
"mt"
)
type App_ struct {
type App struct {
f5.App_
msgMutex sync.Mutex
msgList q5.ListHead
workList q5.ListHead
}
var App = new (App_)
var app = new (App)
func (this *App_) Init() {
func (this *App) Init() {
f5.App = &this.App_
f5.App.SetPkgName("imserver")
this.App_.Init(this.Update)
@ -32,13 +32,13 @@ func (this *App_) Init() {
go this.goReportServerState()
}
func (this *App_) UnInit() {
func (this *App) UnInit() {
HandlerMgr.UnInit()
WSPListener.UnInit()
this.App_.UnInit()
}
func (this *App_) Update() {
func (this *App) Update() {
if this.workList.Empty() {
this.msgMutex.Lock()
defer this.msgMutex.Unlock()
@ -59,7 +59,7 @@ func (this *App_) Update() {
}
}
func (this *App_) goReportServerState() {
func (this *App) goReportServerState() {
for {
params := q5.NewMxoObject()
params.SetXValue("node_id", q5.NewXInt32(1))
@ -80,7 +80,7 @@ func (this *App_) goReportServerState() {
}
func (this *App_) addNetMsg(hdr *f5.MsgHdr) {
func (this *App) addNetMsg(hdr *f5.MsgHdr) {
{
this.msgMutex.Lock()
defer this.msgMutex.Unlock()

View File

@ -1,7 +1,7 @@
package main
func main() {
App.Init()
App.Run()
App.UnInit()
app.Init()
app.Run()
app.UnInit()
}