/// <summary> /// Initializes a new instance of the <see cref="WhoisLookup"/> class with the given <see cref="WhoisOptions"/>. /// </summary> public WhoisLookup(WhoisOptions options) { Options = options; whoisParser = new WhoisParser(); TcpReader = new TcpReader(); ServerLookup = new IanaServerLookup(TcpReader); }
static WhoisOptions() { Defaults = new WhoisOptions { DefaultEncoding = Encoding.UTF8, ParseWhoisResponse = true, ThrowOnParsingException = true }; }
static WhoisOptions() { Defaults = new WhoisOptions { Encoding = Encoding.UTF8, FollowReferrer = true, TimeoutSeconds = 10 }; }
/// <summary> /// Initializes a new instance of the <see cref="WhoisLookup"/> class. /// </summary> public WhoisLookup(WhoisOptions options) { patternExtractorVisitor = new PatternExtractorVisitor(); Options = options; Visitors = new List <IWhoisVisitor> { // Validate input new ValidateVisitor(), // Get initial WHOIS server URL new WhoisServerVisitor(), // Download from initial server new DownloadVisitor(), // Check to see if a secondard WHOIS server needs to be queried new RedirectVisitor(), // Populate Structured WHOIS object patternExtractorVisitor }; }