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 } }() }
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, "") } }