Example #1
0
        private void ReceiveHeartbeatRsp(int uid)
        {
            var from = Sender.Path.Address;

            if (_failureDetector.IsMonitoring(from))
            {
                Log.Debug("Received heartbeat rsp from [{0}]", from);
            }
            else
            {
                Log.Debug("Received first heartbeat rsp from [{0}]", from);
            }

            if (WatcheeByNodes.ContainsKey(from) && !Unreachable.Contains(from))
            {
                if (_addressUids.TryGetValue(from, out int addressUid))
                {
                    if (addressUid != uid)
                    {
                        ReWatch(from);
                    }
                }
                else
                {
                    ReWatch(from);
                }

                _addressUids[from] = uid;
                _failureDetector.Heartbeat(from);
            }
        }
Example #2
0
        private void ReceiveHeartbeatRsp(int uid)
        {
            var from = Sender.Path.Address;

            if (_failureDetector.IsMonitoring(from))
            {
                _log.Debug("Received heartbeat rsp from [{0}]", from);
            }
            else
            {
                _log.Debug("Received first heartbeat rsp from [{0}]", from);
            }

            if (_watchingNodes.Contains(from) && !_unreachable.Contains(from))
            {
                if (!_addressUids.ContainsKey(from) || _addressUids[from] != uid)
                {
                    ReWatch(from);
                }
                _addressUids[from] = uid;
                _failureDetector.Heartbeat(from);
            }
        }