public DnsAgent(Options options, Rules rules, string listenOn, DnsMessageCache cache) { Options = options ?? new Options(); Rules = rules ?? new Rules(); _listenOn = listenOn; Cache = cache ?? new DnsMessageCache(); }
private static Options ReadOptions() { Options options; if (File.Exists(Path.Combine(Environment.CurrentDirectory, OptionsFileName))) { options = JsonConvert.DeserializeObject<Options>( File.ReadAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName))); } else { options = new Options(); File.WriteAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName), JsonConvert.SerializeObject(options, Formatting.Indented)); } return options; }
public DnsAgent(Options options, Rules rules) { Options = options ?? new Options(); Rules = rules ?? new Rules(); Cache = new DnsMessageCache(); }