public override bool Equals(object obj) { DnsQueryResponse that = obj as DnsQueryResponse; return(((that != null) && object.Equals(this.Query, that.Query)) && object.Equals(this.Response, that.Response)); }
public override void Define() { DnsQueryResponse qr = null; When() .Match(() => qr, x => x.Response.DnsTime > 5.0); Then() .Do(ctx => ctx.Warn($"Response time is high ({qr.Response.DnsTime}s) for DNS query {qr.Query} and its response {qr.Response}.")) .Yield(_ => new LateResponse { Query = qr.Query, Response = qr.Response, Delay = qr.Response.DnsTime }); }
public override void Define() { DnsQueryResponse qr = null; When() .Match <DnsQueryResponse>(() => qr, x => x.Response.DnsFlagsRcode != 0); Then() .Do(ctx => ctx.Error($"DNS query {qr.Query} yields to error {(DnsResponseCode)qr.Response.DnsFlagsRcode} ({ResponseCodeDescription[(DnsResponseCode)qr.Response.DnsFlagsRcode]}) . DNS response {qr.Response}. Response time was {qr.Response.DnsTime}s.")) .Yield(ctx => new ResponseError { Query = qr.Query, Response = qr.Response }); }