protected void Information(ISniffable Output, string Info) { foreach (ISniffer Sniffer in Output.Sniffers) { Sniffer.Information(this.topic.FullTopic + ": " + Info); } }
/// <summary> /// Class redirecting sniffer output to a remote client. /// </summary> /// <param name="FullJID">Full JID of remote client.</param> /// <param name="Expires">When the sniffer should automatically expire.</param> /// <param name="Node">Node being sniffed.</param> /// <param name="ConcentratorServer">Concentrator server managing nodes.</param> public RemoteSniffer(string FullJID, DateTime Expires, ISniffable Node, ConcentratorServer ConcentratorServer) { this.id = Guid.NewGuid().ToString().Replace("-", string.Empty); this.fullJID = FullJID; this.expires = Expires; this.node = Node; this.concentratorServer = ConcentratorServer; }
public override void SnifferOutput(ISniffable Output) { if (this.value == null) { this.Information(Output, "NULL"); } else if (this.value.Length == 1) { this.Information(Output, "1 byte."); } else { this.Information(Output, this.value.Length.ToString() + " bytes."); } }
/// <summary> /// Sending sniffer events to the corresponding web page(s). /// </summary> /// <param name="SnifferId">Sniffer ID</param> /// <param name="PageResource">Resource of page displaying the sniffer.</param> /// <param name="MaxLife">Maximum life of sniffer.</param> /// <param name="BinaryPresentationMethod">How binary data is to be presented.</param> /// <param name="Sniffable">Object being sniffed</param> /// <param name="UserVariable">Event is only pushed to clients with a session contining a variable /// named <paramref name="UserVariable"/> having a value derived from <see cref="IUser"/>.</param> /// <param name="Privileges">Event is only pushed to clients with a user variable having the following set of privileges.</param> public WebSniffer(string SnifferId, string PageResource, TimeSpan MaxLife, BinaryPresentationMethod BinaryPresentationMethod, ISniffable Sniffable, string UserVariable, params string[] Privileges) : base() { this.expires = DateTime.Now.Add(MaxLife); this.sniffable = Sniffable; this.snifferId = SnifferId; this.resource = PageResource; this.binaryPresentationMethod = BinaryPresentationMethod; this.tabIds = null; this.userVariable = UserVariable; this.privileges = Privileges; this.feedbackCheck = Sniffable is HttpServer; if (this.feedbackCheck) { this.outgoing = new Cache <string, bool>(int.MaxValue, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)); } else { this.outgoing = null; } }
public override void SnifferOutput(ISniffable Output) { this.Information(Output, this.value.ToString()); }
public abstract void SnifferOutput(ISniffable Output);
public override void SnifferOutput(ISniffable Output) { this.Information(Output, this.value.ToString("F" + this.nrDecimals.ToString()) + " " + this.unit); }