FurinaImpact/FurinaImpact.Kcp/KcpReceiveWindowNotificationOptions.cs
2023-12-09 06:45:08 +03:00

37 lines
1.4 KiB
C#

namespace FurinaImpact.Kcp
{
/// <summary>
/// Options for sending receive window size notification.
/// </summary>
public sealed class KcpReceiveWindowNotificationOptions
{
/// <summary>
/// Create an instance of option object for receive window size notification functionality.
/// </summary>
/// <param name="initialInterval">The initial interval in milliseconds of sending window size notification.</param>
/// <param name="maximumInterval">The maximum interval in milliseconds of sending window size notification.</param>
public KcpReceiveWindowNotificationOptions(int initialInterval, int maximumInterval)
{
if (initialInterval <= 0)
{
throw new ArgumentOutOfRangeException(nameof(initialInterval));
}
if (maximumInterval < initialInterval)
{
throw new ArgumentOutOfRangeException(nameof(maximumInterval));
}
InitialInterval = initialInterval;
MaximumInterval = maximumInterval;
}
/// <summary>
/// The initial interval in milliseconds of sending window size notification.
/// </summary>
public int InitialInterval { get; }
/// <summary>
/// The maximum interval in milliseconds of sending window size notification.
/// </summary>
public int MaximumInterval { get; }
}
}