private void Whois_ExceptionThrown(object sender, YaWhoisClientEventArgs e) { var data = (YaWhoisData)e.Value; e.Exception.Data.Add("object", data.Object); data.Client.SendAsync("Result", data.Object, e.Exception.Message).Wait(); }
private void Whois_ResponseParsed(object sender, YaWhoisClientEventArgs e) { var data = (YaWhoisData)e.Value; if (string.IsNullOrEmpty(e.Response)) { data.Client.SendAsync("Result", data.Object, "").Wait(); } if (_dbStatus.Connected) { UpsertRecordAsync(data.Object, e.Response).Wait(); } data.Client.SendAsync("Result", data.Object, e.Response).Wait(); }
private static void Whois_ResponseParsed(object sender, YaWhoisClientEventArgs e) { var verbose = (bool)e.Value; if (verbose) { Console.WriteLine($"[server: {e.Server}]"); Console.WriteLine($"[query: {e.Query}]"); Console.WriteLine($"[encoding: {e.Encoding.WebName}]"); if (!string.IsNullOrEmpty(e.Referral)) { Console.WriteLine($"[referral: {e.Referral}]"); } Console.WriteLine(); } Console.WriteLine(e.Response.TrimEnd(new char[] { '\r', '\n' })); Console.WriteLine(); }