Akka.Remote.EndpointRegistry.IsQuarantined C# (CSharp) Метод

IsQuarantined() публичный Метод

public IsQuarantined ( Akka.Actor.Address address, int uid ) : bool
address Akka.Actor.Address
uid int
Результат bool
        public bool IsQuarantined(Address address, int uid)
        {
            // timeOfRelease is only used for garbage collection. If an address is still probed, we should report the
            // known fact that it is quarantined.
            var policy = WritableEndpointWithPolicyFor(address) as EndpointManager.Quarantined;
            return policy?.Uid == uid;
        }

Usage Example

Пример #1
0
        private void HandleInboundAssociation(InboundAssociation ia)
        {
            var readonlyEndpoint = endpoints.ReadOnlyEndpointFor(ia.Association.RemoteAddress);
            var handle           = ia.Association.AsInstanceOf <AkkaProtocolHandle>();

            if (readonlyEndpoint != null)
            {
                if (pendingReadHandoffs.ContainsKey(readonlyEndpoint))
                {
                    pendingReadHandoffs[readonlyEndpoint].Disassociate();
                }
                pendingReadHandoffs.AddOrSet(readonlyEndpoint, handle);
                readonlyEndpoint.Tell(new EndpointWriter.TakeOver(handle));
            }
            else
            {
                if (endpoints.IsQuarantined(handle.RemoteAddress, (int)handle.HandshakeInfo.Uid))
                {
                    handle.Disassociate(DisassociateInfo.Quarantined);
                }
                else
                {
                    endpoints.WritableEndpointWithPolicyFor(handle.RemoteAddress).Match()
                    .With <Pass>(pass =>
                    {
                        if (!pass.Uid.HasValue)
                        {
                            if (stashedInbound.ContainsKey(pass.Endpoint))
                            {
                                stashedInbound[pass.Endpoint].Add(ia);
                            }
                            else
                            {
                                stashedInbound.AddOrSet(pass.Endpoint, new List <InboundAssociation>()
                                {
                                    ia
                                });
                            }
                        }
                        else
                        {
                            if (handle.HandshakeInfo.Uid == pass.Uid)
                            {
                                if (pendingReadHandoffs.ContainsKey(pass.Endpoint))
                                {
                                    pendingReadHandoffs[pass.Endpoint].Disassociate();
                                }
                                pendingReadHandoffs.AddOrSet(pass.Endpoint, handle);
                                pass.Endpoint.Tell(new EndpointWriter.StoppedReading(pass.Endpoint));
                            }
                            else
                            {
                                Context.Stop((InternalActorRef)pass.Endpoint);
                                endpoints.UnregisterEndpoint(pass.Endpoint);
                                pendingReadHandoffs.Remove(pass.Endpoint);
                                CreateAndRegisterEndpoint(handle, pass.Uid);
                            }
                        }
                    })
                    .Default(state =>
                    {
                        CreateAndRegisterEndpoint(handle, null);
                    });
                }
            }
        }
All Usage Examples Of Akka.Remote.EndpointRegistry::IsQuarantined