mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-07-30 17:30:40 +00:00
RateControl
This commit is contained in:
@@ -8,6 +8,45 @@ namespace Esiur.Resource;
|
||||
public sealed class WarehouseConfiguration
|
||||
{
|
||||
public RateControlConfiguration RateControl { get; set; } = new RateControlConfiguration();
|
||||
public ParserConfiguration Parser { get; set; } = new ParserConfiguration();
|
||||
public ResourceAttachmentConfiguration ResourceAttachments { get; set; } = new ResourceAttachmentConfiguration();
|
||||
public ConnectionConfiguration Connections { get; set; } = new ConnectionConfiguration();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Limits memory and object amplification while parsing untrusted packets.
|
||||
/// A value of zero disables the corresponding limit.
|
||||
/// </summary>
|
||||
public sealed class ParserConfiguration
|
||||
{
|
||||
/// <summary>Maximum declared TDU payload retained for one packet.</summary>
|
||||
public uint MaximumPacketSize { get; set; } = 8 * 1024 * 1024;
|
||||
|
||||
/// <summary>Maximum allocation produced by one decoded value.</summary>
|
||||
public uint MaximumAllocationSize { get; set; } = 4 * 1024 * 1024;
|
||||
|
||||
/// <summary>Maximum number of values decoded into one collection.</summary>
|
||||
public int MaximumCollectionItems { get; set; } = 65_536;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Limits resources imported from, or attached by, one remote connection.
|
||||
/// A value of zero disables the corresponding limit.
|
||||
/// </summary>
|
||||
public sealed class ResourceAttachmentConfiguration
|
||||
{
|
||||
public int MaximumAttachedResourcesPerConnection { get; set; } = 4_096;
|
||||
public int MaximumPendingAttachmentsPerConnection { get; set; } = 128;
|
||||
public bool RejectDuplicateAttachments { get; set; } = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures network connection admission limits.
|
||||
/// A value of zero disables the corresponding limit.
|
||||
/// </summary>
|
||||
public sealed class ConnectionConfiguration
|
||||
{
|
||||
public int MaximumConnectionsPerIpAddress { get; set; } = 64;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user