/// <summary> /// Reads the member status from a stream. /// </summary> /// <param name="input">The input stream.</param> public ClusterMemberStatus(EnhancedStream input) { properties = input.ReadProperties(StringComparer.OrdinalIgnoreCase); try { string v; if (!properties.TryGetValue("_state", out v)) { this.State = ClusterMemberState.Unknown; } else { this.State = (ClusterMemberState)Enum.Parse(typeof(ClusterMemberState), v); } } catch { this.State = ClusterMemberState.Unknown; } this.Mode = this.Settings.Mode; this.InstanceEP = properties["_instance-ep"]; this.MachineName = properties["_machine-name"]; this.ProtocolCaps = (ClusterMemberProtocolCaps)int.Parse(properties["_caps"]); }
/// <summary> /// Constructor. /// </summary> /// <param name="instanceEP">The member's instance endpoint.</param> /// <param name="state">The member's current state.</param> /// <param name="settings">The cluster member's settings.</param> public ClusterMemberStatus(MsgEP instanceEP, ClusterMemberState state, ClusterMemberSettings settings) { this.InstanceEP = instanceEP; this.State = state; this.Mode = settings.Mode; this.MachineName = Helper.MachineName; this.ProtocolCaps = ClusterMemberProtocolCaps.Current; this.properties = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); settings.SaveTo(this); }