func (this *Inspector) GetInspectorTasksForever() { for { if len(this.taskPool.tasks) == 0 && this.session != nil { this.session.Send(types.AlarmPack(types.ALAR_MESS_GET_INSPECTOR_TASK, types.NewHeartBeat(this.session.LocalAddr(), GetHostName()))) } time.Sleep(time.Millisecond * 100) } }
func (this *Inspector) HeartBeatForever() { for { if this.session != nil { this.session.Send(types.AlarmPack(types.ALAR_MESS_HEARTBEAT, types.NewHeartBeat(this.session.LocalAddr(), GetHostName()))) } time.Sleep(time.Second * 30) } }