mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-31 03:02:39 +08:00
Set max pending mesages per client to 1000 (#2096)
Set max pending mesages per client to 1000.
This commit is contained in:
@@ -2,38 +2,35 @@
|
|||||||
// The .NET Foundation licenses this file to you under the MIT license.
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System;
|
namespace MQTTnet.Server;
|
||||||
|
|
||||||
namespace MQTTnet.Server
|
public sealed class MqttServerOptions
|
||||||
{
|
{
|
||||||
public sealed class MqttServerOptions
|
public TimeSpan DefaultCommunicationTimeout { get; set; } = TimeSpan.FromSeconds(100);
|
||||||
{
|
|
||||||
public TimeSpan DefaultCommunicationTimeout { get; set; } = TimeSpan.FromSeconds(100);
|
|
||||||
|
|
||||||
public MqttServerTcpEndpointOptions DefaultEndpointOptions { get; } = new MqttServerTcpEndpointOptions();
|
public MqttServerTcpEndpointOptions DefaultEndpointOptions { get; } = new();
|
||||||
|
|
||||||
public bool EnablePersistentSessions { get; set; }
|
public bool EnablePersistentSessions { get; set; }
|
||||||
|
|
||||||
public MqttServerKeepAliveOptions KeepAliveOptions { get; } = new MqttServerKeepAliveOptions();
|
public MqttServerKeepAliveOptions KeepAliveOptions { get; } = new();
|
||||||
|
|
||||||
public int MaxPendingMessagesPerClient { get; set; } = 250;
|
public int MaxPendingMessagesPerClient { get; set; } = 1000;
|
||||||
|
|
||||||
public MqttPendingMessagesOverflowStrategy PendingMessagesOverflowStrategy { get; set; } = MqttPendingMessagesOverflowStrategy.DropOldestQueuedMessage;
|
public MqttPendingMessagesOverflowStrategy PendingMessagesOverflowStrategy { get; set; } = MqttPendingMessagesOverflowStrategy.DropOldestQueuedMessage;
|
||||||
|
|
||||||
public MqttServerTlsTcpEndpointOptions TlsEndpointOptions { get; } = new MqttServerTlsTcpEndpointOptions();
|
public MqttServerTlsTcpEndpointOptions TlsEndpointOptions { get; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the default and initial size of the packet write buffer.
|
/// Gets or sets the default and initial size of the packet write buffer.
|
||||||
/// It is recommended to set this to a value close to the usual expected packet size * 1.5.
|
/// It is recommended to set this to a value close to the usual expected packet size * 1.5.
|
||||||
/// Do not change this value when no memory issues are experienced.
|
/// Do not change this value when no memory issues are experienced.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WriterBufferSize { get; set; } = 4096;
|
public int WriterBufferSize { get; set; } = 4096;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the maximum size of the buffer writer. The writer will reduce its internal buffer
|
/// Gets or sets the maximum size of the buffer writer. The writer will reduce its internal buffer
|
||||||
/// to this value after serializing a packet.
|
/// to this value after serializing a packet.
|
||||||
/// Do not change this value when no memory issues are experienced.
|
/// Do not change this value when no memory issues are experienced.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WriterBufferSizeMax { get; set; } = 65535;
|
public int WriterBufferSizeMax { get; set; } = 65535;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,4 +7,5 @@
|
|||||||
* Changed code signing and nuget certificate
|
* Changed code signing and nuget certificate
|
||||||
* Namespace changes **(BREAKING CHANGE)**
|
* Namespace changes **(BREAKING CHANGE)**
|
||||||
* Removal of Managed Client **(BREAKING CHANGE)**
|
* Removal of Managed Client **(BREAKING CHANGE)**
|
||||||
* Client: MQTT 5.0.0 is now the default version when connecting with a server **(BREAKING CHANGE)**
|
* Client: MQTT 5.0.0 is now the default version when connecting with a server **(BREAKING CHANGE)**
|
||||||
|
* Server: Set default for "MaxPendingMessagesPerClient" to 1000 **(BREAKING CHANGE)**
|
||||||
Reference in New Issue
Block a user