Show / Hide Table of Contents

Class RecentMessages

Maintains a sequence of recent messages.

Inheritance
Object
RecentMessages
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Makaretu.Dns
Assembly: Makaretu.Dns.Multicast.dll
Syntax
public class RecentMessages
Remarks

RecentMessages is used to determine if a message has already been processed within the specified Interval.

Fields

| Improve this Doc View Source

Messages

Recent messages.

Declaration
public ConcurrentDictionary<string, DateTime> Messages
Field Value
Type Description
ConcurrentDictionary<String, DateTime>

The key is the Base64 encoding of the MD5 hash of a message and the value is when the message was seen.

Properties

| Improve this Doc View Source

Interval

The time interval used to determine if a message is recent.

Declaration
public TimeSpan Interval { get; set; }
Property Value
Type Description
TimeSpan

Methods

| Improve this Doc View Source

GetId(Byte[])

Gets a unique ID for a message.

Declaration
public string GetId(byte[] message)
Parameters
Type Name Description
Byte[] message

The binary representation of a message.

Returns
Type Description
String

The Base64 encoding of the MD5 hash of the message.

| Improve this Doc View Source

Prune()

Remove any messages that are stale.

Declaration
public int Prune()
Returns
Type Description
Int32

The number messages that were pruned.

Remarks

Anything older than an Interval ago is removed.

| Improve this Doc View Source

TryAdd(Byte[])

Try adding a message to the recent message list.

Declaration
public bool TryAdd(byte[] message)
Parameters
Type Name Description
Byte[] message

The binary representation of a message.

Returns
Type Description
Boolean

true if the message, did not already exist; otherwise, false the message exists within the Interval.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX