From 1b28b28a3e4eb6a24b2dfd460c18d7a37997f378 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Aug 2023 15:57:11 +0800 Subject: [PATCH] 1 --- server/imserver/WSPListener.go | 2 +- server/imserver/app.go | 14 +++++++------- server/imserver/main.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/imserver/WSPListener.go b/server/imserver/WSPListener.go index f0baea5d..f4ecb34e 100644 --- a/server/imserver/WSPListener.go +++ b/server/imserver/WSPListener.go @@ -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) } } } diff --git a/server/imserver/app.go b/server/imserver/app.go index ed50eb7d..b39fe453 100644 --- a/server/imserver/app.go +++ b/server/imserver/app.go @@ -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() diff --git a/server/imserver/main.go b/server/imserver/main.go index 4575b2db..ca0e2adf 100644 --- a/server/imserver/main.go +++ b/server/imserver/main.go @@ -1,7 +1,7 @@ package main func main() { - App.Init() - App.Run() - App.UnInit() + app.Init() + app.Run() + app.UnInit() }