1234567891011121314151617181920212223242526272829 |
- using XGame.Framework.Interfaces;
- namespace XGame.Framework.Network
- {
- internal interface IHeartbeatListener
- {
- /// <summary>
- /// 心跳包超时回调
- /// </summary>
- void OnTimeout();
- }
- public interface IHeartbeat : IRunnable
- {
- /// <summary>
- /// 心跳发送的间隔,默认6秒
- /// </summary>
- int Interval { get; set; }
- /// <summary>
- /// 心跳接收超时时间,默认12秒
- /// </summary>
- int Timeout { get; set; }
- /// <summary>
- /// 心跳接收
- /// </summary>
- void Receive();
- }
- }
|