wenxiangchao
3 天以前 b544d5cccd76735e034c8055918a50927b437474
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using Aging.ResourceContracts;
 
namespace Aging.Infrastructure.Broker
{
    /// <summary>
    /// DeviceBroker 命名管道服务名约定:aging.{brokerId}.v{协议主版本}
    /// (V3.0 §13:服务名含 Station/Broker/协议主版本)。
    /// </summary>
    public static class BrokerPipeName
    {
        public static string For(string brokerId)
        {
            if (string.IsNullOrWhiteSpace(brokerId))
                throw new ArgumentException("brokerId 不能为空", nameof(brokerId));
            return $"aging.{brokerId.Trim().ToLowerInvariant()}.v{BrokerIpc.ProtocolVersion}";
        }
    }
}