IHeartbeat.cs 644 B

1234567891011121314151617181920212223242526272829
  1. using XGame.Framework.Interfaces;
  2. namespace XGame.Framework.Network
  3. {
  4. internal interface IHeartbeatListener
  5. {
  6. /// <summary>
  7. /// 心跳包超时回调
  8. /// </summary>
  9. void OnTimeout();
  10. }
  11. public interface IHeartbeat : IRunnable
  12. {
  13. /// <summary>
  14. /// 心跳发送的间隔,默认6秒
  15. /// </summary>
  16. int Interval { get; set; }
  17. /// <summary>
  18. /// 心跳接收超时时间,默认12秒
  19. /// </summary>
  20. int Timeout { get; set; }
  21. /// <summary>
  22. /// 心跳接收
  23. /// </summary>
  24. void Receive();
  25. }
  26. }