Table of Contents

Struct MessageBrokerServerNetworkPacketOptions

Namespace
LfrlAnvil.MessageBroker.Server
Assembly
LfrlAnvil.MessageBroker.Server.dll

Represents available network packet options during MessageBrokerServer creation.

public readonly record struct MessageBrokerServerNetworkPacketOptions : IEquatable<MessageBrokerServerNetworkPacketOptions>
Implements
Inherited Members

Constructors

MessageBrokerServerNetworkPacketOptions(MemorySize?, MemorySize?, MemorySize?, short?)

Represents available network packet options during MessageBrokerServer creation.

public MessageBrokerServerNetworkPacketOptions(MemorySize? MaxLength, MemorySize? MaxMessageLength, MemorySize? MaxBatchLength, short? MaxBatchPacketCount)

Parameters

MaxLength MemorySize?

Max network packet length and min segment length for each client's underlying memory pool. Equal to 16 KB by default. Value will be clamped to [16 KB, 1 MB] range. Represents max possible length for packets not handled by either MaxMessageLength or MaxBatchLength.

MaxMessageLength MemorySize?

Max network message packet length. Equal to 10 MB by default. Value will be clamped to [MaxLength, 1 GB] range. Represents max possible length for outbound packets of MessageNotification type or inbound packets of PushMessage type.

MaxBatchLength MemorySize?

Max network batch packet length. Equal to 10 MB by default. Value will be clamped to [MaxLength, 1 GB] range. Represents max possible length for packets of Batch type.

MaxBatchPacketCount short?

Max number of packets in a single network batch packet. Equal to 100 by default. Value will be clamped to [0, 32767] range. Value equal to 1 will be changed to 0.

Properties

Default

Represents default options.

public static MessageBrokerServerNetworkPacketOptions Default { get; }

Property Value

MessageBrokerServerNetworkPacketOptions

MaxBatchLength

Max network batch packet length. Equal to 10 MB by default. Value will be clamped to [MaxLength, 1 GB] range. Represents max possible length for packets of Batch type.

public MemorySize? MaxBatchLength { get; init; }

Property Value

MemorySize?

MaxBatchPacketCount

Max number of packets in a single network batch packet. Equal to 100 by default. Value will be clamped to [0, 32767] range. Value equal to 1 will be changed to 0.

public short? MaxBatchPacketCount { get; init; }

Property Value

short?

MaxLength

Max network packet length and min segment length for each client's underlying memory pool. Equal to 16 KB by default. Value will be clamped to [16 KB, 1 MB] range. Represents max possible length for packets not handled by either MaxMessageLength or MaxBatchLength.

public MemorySize? MaxLength { get; init; }

Property Value

MemorySize?

MaxMessageLength

Max network message packet length. Equal to 10 MB by default. Value will be clamped to [MaxLength, 1 GB] range. Represents max possible length for outbound packets of MessageNotification type or inbound packets of PushMessage type.

public MemorySize? MaxMessageLength { get; init; }

Property Value

MemorySize?

Methods

SetMaxBatchLength(MemorySize?)

Allows to change MaxBatchLength.

[Pure]
public MessageBrokerServerNetworkPacketOptions SetMaxBatchLength(MemorySize? value)

Parameters

value MemorySize?

New value.

Returns

MessageBrokerServerNetworkPacketOptions

New MessageBrokerServerNetworkPacketOptions instance.

SetMaxBatchPacketCount(short?)

Allows to change MaxBatchPacketCount.

[Pure]
public MessageBrokerServerNetworkPacketOptions SetMaxBatchPacketCount(short? value)

Parameters

value short?

New value.

Returns

MessageBrokerServerNetworkPacketOptions

New MessageBrokerServerNetworkPacketOptions instance.

SetMaxLength(MemorySize?)

Allows to change MaxLength.

[Pure]
public MessageBrokerServerNetworkPacketOptions SetMaxLength(MemorySize? value)

Parameters

value MemorySize?

New value.

Returns

MessageBrokerServerNetworkPacketOptions

New MessageBrokerServerNetworkPacketOptions instance.

SetMaxMessageLength(MemorySize?)

Allows to change MaxMessageLength.

[Pure]
public MessageBrokerServerNetworkPacketOptions SetMaxMessageLength(MemorySize? value)

Parameters

value MemorySize?

New value.

Returns

MessageBrokerServerNetworkPacketOptions

New MessageBrokerServerNetworkPacketOptions instance.