Example #1
0
File: main.go Project: cokeboL/ZIM
func main() {
	SigHandler.Start(chAppStop)

	Logger.Start(1, 1, 1)

	Monitor.Start(Commen.GetConfig(Commen.WorkerMonitorAddr), NetConf.MONITOR_INTERNAL, chAppStop)

	//DBMgr.Start(Commen.GetConfig(Commen.MysqlAddr), 3, Commen.GetConfig(Commen.MongoAddr), 5, chAppStop)

	NetCore.StartTcpServer(Commen.GetConfig(Commen.WorkerAddr), chAppStop)

	//ServerJob.InitAgent(Commen.GetConfig(Commen.CourierAddr), NetConf.Worker, chAppStop)

	WaitStop()
}
Example #2
0
File: main.go Project: cokeboL/ZIM
func main() {
	SigHandler.Start(chAppStop)

	Logger.Start(1, 1, 1)

	Monitor.Start(Commen.GetConfig(Commen.CourierMonitorAddr), NetConf.MONITOR_INTERNAL, chAppStop)

	NetCore.StartTcpServer(Commen.GetConfig(Commen.CourierAddr), chAppStop)

	InitHandlers()

	EventMgrExample()

	WaitStop()
}
Example #3
0
func main() {
	SigHandler.Start()

	Logger.Start(1, 1, 1)

	Monitor.Start(Commen.GetConfig(Commen.WorkerMonitorAddr), 5, chAppStop)

	ServerJob.InitHandlers()

	ClientJob.InitHandlers()

	DBMgr.Start(Commen.GetConfig(Commen.MysqlAddr), 3, Commen.GetConfig(Commen.MongoAddr), 5, chAppStop)

	NetCore.StartTcpServer(Commen.GetConfig(Commen.WorkerAddr), chAppStop)

	ServerJob.InitAgent(Commen.GetConfig(Commen.CourierAddr), NetConf.Worker, chAppStop)

	WaitStop()
}
Example #4
0
func main() {
	SigHandler.Start(chAppStop)

	Logger.Start(1, 1, 1)

	Monitor.Start(Commen.GetConfig(Commen.AdminMonitorAddr), NetConf.MONITOR_INTERNAL, chAppStop)

	ServerJob.InitHandlers()

	ServerJob.InitAgent(Commen.GetConfig(Commen.CourierAddr), NetConf.Admin, chAppStop)

	port, err := strconv.Atoi(Commen.GetConfig(Commen.AdminPort))
	if err != nil {
		Logger.Println("Server Stop, Get Config Port Error:", Commen.GetConfig(Commen.AdminPort), err)
		os.Exit(0)
	}
	HomePage.Start(port)

	WaitStop()
}
Example #5
0
func main() {
	parseFlag()

	if showVersion {
		fmt.Printf("version %s\n", "1.0.0")
		os.Exit(0)
	}

	//
	outputPid()

	l, err := ilog.InitLog("log")
	if err != nil {
		log.Fatalf("listen failed! [%s]", err.Error())
	}

	go signalHandle(l)

	if toProfile {
		prof.StartProf()
	}

	if err := config.Start(sConfigPath); err != nil {
		ilog.Printf("config start failed![%s]", err.Error())
	}

	if err := data.Start(); err != nil {
		ilog.Printf("data start failed![%s]", err.Error())
	}

	if err := monitor.Start(); err != nil {
		ilog.Printf("monitor start failed![%s]", err.Error())
	}

	if err := web.Start(); err != nil {
		ilog.Printf("web start failed![%s]", err.Error())
	}

	os.Exit(0)
}