diff --git a/server/imserver/app.go b/server/imserver/app.go index f1d604be..8d8f6ead 100644 --- a/server/imserver/app.go +++ b/server/imserver/app.go @@ -1,6 +1,10 @@ package main import ( + "time" + "fmt" + + "q5" "f5" ) @@ -10,12 +14,34 @@ type App_ struct { var App = new (App_) + func (this *App_) Init() { f5.App = &this.App_ f5.App.SetPkgName("imserver") this.App_.Init() + go this.goReportServerState(); } func (this *App_) UnInit() { this.App_.UnInit() } + +func (this *App_) goReportServerState() { + for (true) { + params := q5.NewMxoObject() + params.SetXValue("node_id", q5.NewXInt32(1)) + params.SetXValue("instance_id", q5.NewXInt32(1)) + params.SetXValue("ip", q5.NewXString("192.168.100.39")) + params.SetXValue("port", q5.NewXInt32(3333)) + params.SetXValue("online_num", q5.NewXInt32(1)) + params.SetXValue("room_num", q5.NewXInt32(1)) + params.SetXValue("channel", q5.NewXInt32(1)) + params.SetXValue("alive_count", q5.NewXInt32(1)) + params.SetXValue("servicing", q5.NewXInt32(1)) + _, err := q5.HttpGet( + "http://192.168.100.45:7821/webapp/index.php?c=GS&a=report&", + params.AsXObject()) + fmt.Println(err); + time.Sleep(time.Duration(1) * time.Second) + } +}