mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-21 12:16:02 +08:00
Use latest language features (#2176)
* Make use of language features line AsyncDispose, init etc. * Fix build errors * Improve Unit Tests * Improve Unit Tests * Improve Unit Tests * Update samples * Remove obsolete benchmarks * Code cleanup * Improve unit tests * Improve Unit Tests * Fix Unit Tests * Improve Unit Tests * Improve Unit Tests * Restore unit tests * Exclude load tests from unit tests
This commit is contained in:
@@ -5,59 +5,58 @@
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace MQTTnet.Server
|
||||
namespace MQTTnet.Server;
|
||||
|
||||
public abstract class MqttServerTcpEndpointBaseOptions
|
||||
{
|
||||
public abstract class MqttServerTcpEndpointBaseOptions
|
||||
{
|
||||
public bool IsEnabled { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
public int Port { get; set; }
|
||||
public int Port { get; set; }
|
||||
|
||||
public int ConnectionBacklog { get; set; } = 100;
|
||||
public int ConnectionBacklog { get; set; } = 100;
|
||||
|
||||
public bool NoDelay { get; set; } = true;
|
||||
public bool NoDelay { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the sockets keep alive feature should be used.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public bool? KeepAlive { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets whether the sockets keep alive feature should be used.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public bool? KeepAlive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Usually the MQTT packets can be send partially. This is done by using multiple TCP packets
|
||||
/// or WebSocket frames etc. Unfortunately not all clients do support this feature and
|
||||
/// will close the connection when receiving such packets. If such clients are connecting to this
|
||||
/// server the flag must be set to _false_.
|
||||
/// </summary>
|
||||
public bool AllowPacketFragmentation { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Usually the MQTT packets can be send partially. This is done by using multiple TCP packets
|
||||
/// or WebSocket frames etc. Unfortunately not all clients do support this feature and
|
||||
/// will close the connection when receiving such packets. If such clients are connecting to this
|
||||
/// server the flag must be set to _false_.
|
||||
/// </summary>
|
||||
public bool AllowPacketFragmentation { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive interval.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveInterval { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive interval.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive retry count.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveRetryCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive retry count.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveRetryCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive time.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveTime { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the TCP keep alive time.
|
||||
/// The value _null_ indicates that the OS and framework defaults should be used.
|
||||
/// </summary>
|
||||
public int? TcpKeepAliveTime { get; set; }
|
||||
|
||||
public LingerOption LingerState { get; set; } = new LingerOption(true, 0);
|
||||
public LingerOption LingerState { get; set; } = new LingerOption(true, 0);
|
||||
|
||||
public IPAddress BoundInterNetworkAddress { get; set; } = IPAddress.Any;
|
||||
public IPAddress BoundInterNetworkAddress { get; set; } = IPAddress.Any;
|
||||
|
||||
public IPAddress BoundInterNetworkV6Address { get; set; } = IPAddress.IPv6Any;
|
||||
public IPAddress BoundInterNetworkV6Address { get; set; } = IPAddress.IPv6Any;
|
||||
|
||||
/// <summary>
|
||||
/// This requires admin permissions on Linux.
|
||||
/// </summary>
|
||||
public bool ReuseAddress { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// This requires admin permissions on Linux.
|
||||
/// </summary>
|
||||
public bool ReuseAddress { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user