private static void Client_OnIdleState(object sender, Peach.EventArgs.IdleStateEventArgs <CommandLineMessage> e) { Task.Run(async() => { Console.WriteLine("send idel cmd"); var idelCmd = new CommandLineMessage("idle"); await e.Context.SendAsync(idelCmd); }); }
/// <summary> /// heart beat /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _socket_OnIdleState(object sender, Peach.EventArgs.IdleStateEventArgs <AmpMessage> e) { this._logger.LogTrace("send heart beat"); e.Context.SendAsync(AmpMessage.HEART_BEAT); }
/// <summary> /// heart beat /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _socket_OnIdleState(object sender, Peach.EventArgs.IdleStateEventArgs <AmpMessage> e) { e.Context.SendAsync(AmpMessage.HEART_BEAT); }