mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-13 21:34:43 +01:00
Init enter game
This commit is contained in:
26
KcpSharp/Base/KcpKeepAliveOptions.cs
Normal file
26
KcpSharp/Base/KcpKeepAliveOptions.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace KianaBH.KcpSharp.Base;
|
||||
|
||||
/// <summary>
|
||||
/// Options for customized keep-alive functionality.
|
||||
/// </summary>
|
||||
public sealed class KcpKeepAliveOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Create an instance of option object for customized keep-alive functionality.
|
||||
/// </summary>
|
||||
/// <param name="sendInterval">The minimum interval in milliseconds between sending keep-alive messages.</param>
|
||||
/// <param name="gracePeriod">
|
||||
/// When no packets are received during this period (in milliseconds), the transport is
|
||||
/// considered to be closed.
|
||||
/// </param>
|
||||
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; }
|
||||
}
|
||||
Reference in New Issue
Block a user