We will always accept a connection from this remote node.
Inheritance: EndpointPolicy
 public void RegisterWritableEndpointUid(IActorRef writer, int uid)
 {
     var address = writableToAddress[writer];
     if (addressToWritable[address] is EndpointManager.Pass)
     {
         var pass = (EndpointManager.Pass) addressToWritable[address];
         addressToWritable[address] = new EndpointManager.Pass(pass.Endpoint, uid);
     }
 }
示例#2
0
 public void RegisterWritableEndpointUid(ActorRef writer, int uid)
 {
     var address = writableToAddress[writer];
     addressToWritable[address].Match()
         .With<EndpointManager.Pass>(pass =>
         {
             addressToWritable[address] = new EndpointManager.Pass(pass.Endpoint, uid);
         });
 }
        public void RegisterWritableEndpointUid(ActorRef writer, int uid)
        {
            var address = writableToAddress[writer];

            if (addressToWritable[address] is EndpointManager.Pass)
            {
                var pass = (EndpointManager.Pass)addressToWritable[address];
                addressToWritable[address] = new EndpointManager.Pass(pass.Endpoint, uid);
            }
        }
示例#4
0
        public void RegisterWritableEndpointUid(ActorRef writer, int uid)
        {
            var address = writableToAddress[writer];

            addressToWritable[address].Match()
            .With <EndpointManager.Pass>(pass =>
            {
                addressToWritable[address] = new EndpointManager.Pass(pass.Endpoint, uid);
            });
        }
 /// <summary>
 /// Sets the UID for an existing <see cref="EndpointManager.Pass"/> policy.
 /// </summary>
 /// <param name="remoteAddress">The address of the remote system.</param>
 /// <param name="uid">The UID of the remote system.</param>
 public void RegisterWritableEndpointUid(Address remoteAddress, int uid)
 {
     if (_addressToWritable.TryGetValue(remoteAddress, out var existing))
     {
         if (existing is EndpointManager.Pass pass)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, uid);
         }
         // if the policy is not Pass, then the GotUid might have lost the race with some failure
     }
 }
示例#6
0
        public void RegisterWritableEndpointUid(IActorRef writer, int uid)
        {
            var address = _writableToAddress[writer];

            if (_addressToWritable[address] is EndpointManager.Pass)
            {
                var pass = (EndpointManager.Pass)_addressToWritable[address];
                _addressToWritable[address] = new EndpointManager.Pass(pass.Endpoint, uid, pass.RefuseUid);
            }

            // if the policy is not Pass, then the GotUid might have lost the race with some failure
        }
示例#7
0
 public void RegisterWritableEndpointUid(Address remoteAddress, int uid)
 {
     EndpointManager.EndpointPolicy existing;
     if (_addressToWritable.TryGetValue(remoteAddress, out existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, uid, pass.RefuseUid);
         }
         // if the policy is not Pass, then the GotUid might have lost the race with some failure
     }
 }
示例#8
0
 public void RegisterWritableEndpointUid(Address remoteAddress, int uid)
 {
     EndpointManager.EndpointPolicy existing;
     if (_addressToWritable.TryGetValue(remoteAddress, out existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, uid, pass.RefuseUid);
         }
         // if the policy is not Pass, then the GotUid might have lost the race with some failure
     }
 }
示例#9
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="address">TBD</param>
        /// <param name="endpoint">TBD</param>
        /// <param name="uid">TBD</param>
        /// <param name="refuseUid">TBD</param>
        /// <exception cref="ArgumentException">
        /// This exception is thrown when the specified <paramref name="address"/> does not have
        /// an <see cref="EndpointManager.EndpointPolicy"/> of <see cref="EndpointManager.Pass"/>
        /// in the registry.
        /// </exception>
        /// <returns>TBD</returns>
        public IActorRef RegisterWritableEndpoint(Address address, IActorRef endpoint, int?uid, int?refuseUid)
        {
            _addressToWritable.TryGetValue(address, out var existing);

            var pass = existing as EndpointManager.Pass;

            if (pass != null) // if we already have a writable endpoint....
            {
                throw new ArgumentException($"Attempting to overwrite existing endpoint {pass.Endpoint} with {endpoint}");
            }

            _addressToWritable[address]  = new EndpointManager.Pass(endpoint, uid, refuseUid);
            _writableToAddress[endpoint] = address;
            return(endpoint);
        }
示例#10
0
        public IActorRef RegisterWritableEndpoint(Address address, IActorRef endpoint, int? uid, int? refuseUid)
        {
            EndpointManager.EndpointPolicy existing;
            _addressToWritable.TryGetValue(address, out existing);

            var pass = existing as EndpointManager.Pass;
            if (pass != null) // if we already have a writable endpoint....
            {
                var e = pass.Endpoint;
                throw new ArgumentException("Attempting to overwrite existing endpoint " + e + " with " + endpoint);
            }

            _addressToWritable[address] = new EndpointManager.Pass(endpoint, uid, refuseUid);
            _writableToAddress[endpoint] = address;
            return endpoint;
        }
示例#11
0
        /// <summary>
        /// Registers a new writable endpoint with the system.
        /// </summary>
        /// <param name="address">The remote address.</param>>
        /// <param name="endpoint">The local endpoint actor who owns this connection.</param>
        /// <param name="uid">The UID of the remote actor system. Can be <c>null</c>.</param>
        /// <exception cref="ArgumentException">
        /// This exception is thrown when the specified <paramref name="address"/> does not have
        /// an <see cref="EndpointManager.EndpointPolicy"/> of <see cref="EndpointManager.Pass"/>
        /// in the registry.
        /// </exception>
        /// <returns>The <see cref="endpoint"/> actor reference.</returns>
        public IActorRef RegisterWritableEndpoint(Address address, IActorRef endpoint, int?uid)
        {
            if (_addressToWritable.TryGetValue(address, out var existing))
            {
                if (existing is EndpointManager.Pass pass) // if we already have a writable endpoint....
                {
                    throw new ArgumentException($"Attempting to overwrite existing endpoint {pass.Endpoint} with {endpoint}");
                }
            }

            // note that this overwrites Quarantine marker,
            // but that is ok since we keep the quarantined uid in addressToRefuseUid
            _addressToWritable[address]  = new EndpointManager.Pass(endpoint, uid);
            _writableToAddress[endpoint] = address;
            return(endpoint);
        }
示例#12
0
 public void RegisterWritableEndpointRefuseUid(Address remoteAddress, int refuseUid)
 {
     EndpointManager.EndpointPolicy existing;
     if (_addressToWritable.TryGetValue(remoteAddress, out existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, pass.Uid, refuseUid);
         } else if (existing is EndpointManager.Gated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Gated(((EndpointManager.Gated)existing).TimeOfRelease, refuseUid);
         }
         else if (existing is EndpointManager.WasGated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.WasGated(refuseUid);
         }
     }
 }
示例#13
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="remoteAddress">TBD</param>
 /// <param name="refuseUid">TBD</param>
 public void RegisterWritableEndpointRefuseUid(Address remoteAddress, int refuseUid)
 {
     if (_addressToWritable.TryGetValue(remoteAddress, out var existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, pass.Uid, refuseUid);
         }
         else if (existing is EndpointManager.Gated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Gated(((EndpointManager.Gated)existing).TimeOfRelease, refuseUid);
         }
         else if (existing is EndpointManager.WasGated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.WasGated(refuseUid);
         }
     }
 }