namespace KianaBH.KcpSharp.Base; /// /// Options for customized keep-alive functionality. /// public sealed class KcpKeepAliveOptions { /// /// Create an instance of option object for customized keep-alive functionality. /// /// The minimum interval in milliseconds between sending keep-alive messages. /// /// When no packets are received during this period (in milliseconds), the transport is /// considered to be closed. /// public KcpKeepAliveOptions(int sendInterval, int gracePeriod) { if (sendInterval <= 0) throw new ArgumentOutOfRangeException(nameof(sendInterval)); if (gracePeriod <= 0) throw new ArgumentOutOfRangeException(nameof(gracePeriod)); SendInterval = sendInterval; GracePeriod = gracePeriod; } internal int SendInterval { get; } internal int GracePeriod { get; } }