重新设计OpcUaBackgroundService后台服务

This commit is contained in:
2025-09-04 21:04:27 +08:00
parent 7fbc99c273
commit 4e73488e8f
7 changed files with 688 additions and 94 deletions

View File

@@ -0,0 +1,43 @@
namespace DMS.Infrastructure.Configuration
{
/// <summary>
/// OPC UA服务配置
/// </summary>
public class OpcUaServiceOptions
{
/// <summary>
/// 配置节名称
/// </summary>
public const string SectionName = "OpcUaService";
/// <summary>
/// 最大并发连接数
/// </summary>
public int MaxConcurrentConnections { get; set; } = 10;
/// <summary>
/// 重连延迟(毫秒)
/// </summary>
public int ReconnectDelayMs { get; set; } = 5000;
/// <summary>
/// 订阅发布间隔(毫秒)
/// </summary>
public int SubscriptionPublishingIntervalMs { get; set; } = 1000;
/// <summary>
/// 订阅采样间隔(毫秒)
/// </summary>
public int SubscriptionSamplingIntervalMs { get; set; } = 1000;
/// <summary>
/// 连接超时时间(毫秒)
/// </summary>
public int ConnectionTimeoutMs { get; set; } = 30000;
/// <summary>
/// 是否自动接受不受信任的证书
/// </summary>
public bool AutoAcceptUntrustedCertificates { get; set; } = true;
}
}