示例#1
0
文件: Agent.go 项目: cokeboL/ZIM
func InitAgent(addr string, stype uint32, chStop chan int) {
	chAppStop = chStop
	go func() {
		var errno int = 0
		errno = NetCore.NewAgent(&courier, addr, stype, "courier")
		if errno > 0 {
			chAppStop <- errno
		}
	}()
}
示例#2
0
文件: main.go 项目: ccppluagopy/Zebra
func start() {
	NetCore.AddMsgHandler(MsgConf.Regist, handleRegist)
	NetCore.AddMsgHandler(MsgConf.HeartBeat2, handleHeartBeat2)

	for i := 0; i < ROBOT_NUM; i++ {
		robots[i] = nil
	}
	for i := 0; i < ROBOT_NUM; i++ {
		NetCore.NewAgent(&robots[i], "127.0.0.1"+Commen.GetConfig(Commen.WorkerAddr), NetConf.Client, "")
	}
}