Exemplo n.º 1
0
        /// <summary>
        /// Returns <c>true</c> if the object passed equals this object.
        /// </summary>
        /// <param name="o">The object to be compared.</param>
        /// <returns><c>true</c> if the objects have the same values.</returns>
        /// <remarks>
        /// <note>
        /// Only the physical endpoint and TCP/UDP endpoints are
        /// compared.  The LogicalRouterSetID and TTD fields are ignored.
        /// </note>
        /// </remarks>
        public override bool Equals(object o)
        {
            var r = o as PhysicalRoute;

            if (r == null)
            {
                return(false);
            }

            if (!routerEP.Equals(r.routerEP))
            {
                return(false);
            }

            if ((r.tcpEP == null) != (this.tcpEP == null) || (this.tcpEP == null) || !this.tcpEP.Equals(r.tcpEP))
            {
                return(false);
            }

            if ((r.udpEP == null) != (this.udpEP == null) || (this.udpEP == null) || !this.udpEP.Equals(r.udpEP))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Removes the information for a cluster member.
 /// </summary>
 /// <param name="instanceEP">The member's instance endpoint.</param>
 public void Remove(MsgEP instanceEP)
 {
     for (int i = 0; i < members.Count; i++)
     {
         if (instanceEP.Equals(members[i].InstanceEP))
         {
             members.RemoveAt(i);
             return;
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Searches the member status for the information for a specifiec
        /// cluster member.
        /// </summary>
        /// <param name="instanceEP">The member's instance endpoint.</param>
        /// <returns>The <see cref="ClusterMemberStatus" /> or <c>null</c> if the requested member is not present.</returns>
        public ClusterMemberStatus GetMemberStatus(MsgEP instanceEP)
        {
            for (int i = 0; i < members.Count; i++)
            {
                if (instanceEP.Equals(members[i].InstanceEP))
                {
                    return(members[i]);
                }
            }

            return(null);
        }