mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
71 lines
2.7 KiB
C#
71 lines
2.7 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
|
|
namespace MQTTnet.Server;
|
|
|
|
public abstract class MqttServerTcpEndpointBaseOptions
|
|
{
|
|
/// <summary>
|
|
/// Usually the MQTT packets can be sent 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 IPv4 network address to bind.
|
|
/// Defaults to any available IPv4 address of the machine.
|
|
/// Set this to `IPAddress.None` to disable the IPv4 support entirely.
|
|
/// </summary>
|
|
public IPAddress BoundInterNetworkAddress { get; set; } = IPAddress.Any;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the IPv6 network address to bind.
|
|
/// Defaults to any available IPv6 address of the machine.
|
|
/// Set this to `IPAddress.None` to disable the IPv6 support entirely.
|
|
/// </summary>
|
|
public IPAddress BoundInterNetworkV6Address { get; set; } = IPAddress.IPv6Any;
|
|
|
|
public int ConnectionBacklog { get; set; } = 100;
|
|
public bool IsEnabled { 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; }
|
|
|
|
public LingerOption LingerState { get; set; } = new(true, 0);
|
|
|
|
public bool NoDelay { get; set; } = true;
|
|
|
|
public int Port { get; set; }
|
|
|
|
/// <summary>
|
|
/// This requires admin permissions on Linux.
|
|
/// </summary>
|
|
public bool ReuseAddress { 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 time.
|
|
/// The value _null_ indicates that the OS and framework defaults should be used.
|
|
/// </summary>
|
|
public int? TcpKeepAliveTime { get; set; }
|
|
} |