Пример #1
0
 internal RaftClusterMember(IHostingContext context, Uri remoteMember, Uri resourcePath)
     : base(context.CreateHttpHandler(), true)
 {
     this.resourcePath = resourcePath;
     this.context      = context;
     status            = new AtomicEnum <ClusterMemberStatus>(ClusterMemberStatus.Unknown);
     BaseAddress       = remoteMember;
     endPoint          = remoteMember.ToEndPoint() ?? throw new UriFormatException(ExceptionMessages.UnresolvedHostName(remoteMember.Host));
     Id = ClusterMemberId.FromEndPoint(endPoint);
     DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(UserAgent, (GetType().Assembly.GetName().Version ?? new Version()).ToString()));
 }
Пример #2
0
 internal CustomMessage(ClusterMemberId sender, IMessage message, MessageReader <T> reader)
     : base(sender, message, DeliveryMode.RequestReply) => this.reader = reader;
Пример #3
0
 private static bool IsMatchedById(RaftClusterMember actual, ClusterMemberId expected)
 => actual.Id == expected;