/// <summary> /// Queries for specified records. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <returns> All available responses on the local network </returns> public List <LlmnrMessage> Resolve(string name, RecordType recordType) { if (String.IsNullOrEmpty(name)) { throw new ArgumentException("Name must be provided", "name"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return(SendMessageParallel(message)); }
/// <summary> /// Queries for specified records asynchronously. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <param name="requestCallback"> /// An <see cref="System.AsyncCallback" /> delegate that references the method to invoked then the operation is complete. /// </param> /// <param name="state"> /// A user-defined object that contains information about the receive operation. This object is passed to the /// <paramref /// name="requestCallback" /> /// delegate when the operation is complete. /// </param> /// <returns> /// An <see cref="System.IAsyncResult" /> IAsyncResult object that references the asynchronous receive. /// </returns> public IAsyncResult BeginResolve(string name, RecordType recordType, AsyncCallback requestCallback, object state) { if (String.IsNullOrEmpty(name)) { throw new ArgumentException("Name must be provided", "name"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return(BeginSendMessageParallel(message, requestCallback, state)); }
/// <summary> /// Queries for specified records. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <returns> All available responses on the local network </returns> public List <LlmnrMessage> Resolve(DomainName name, RecordType recordType = RecordType.A) { if (name == null) { throw new ArgumentNullException(nameof(name), "Name must be provided"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return(SendMessageParallel(message)); }
/// <summary> /// Queries for specified records as an asynchronous operation. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <param name="token"> The token to monitor cancellation requests </param> /// <returns> All available responses on the local network </returns> public Task <List <LlmnrMessage> > ResolveAsync(DomainName name, RecordType recordType = RecordType.A, CancellationToken token = default(CancellationToken)) { if (name == null) { throw new ArgumentNullException(nameof(name), "Name must be provided"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return(SendMessageParallelAsync(message, token)); }
/// <summary> /// Queries for specified records as an asynchronous operation. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <param name="token"> The token to monitor cancellation requests </param> /// <returns> All available responses on the local network </returns> public Task<List<LlmnrMessage>> ResolveAsync(DomainName name, RecordType recordType = RecordType.A, CancellationToken token = default(CancellationToken)) { if (name == null) throw new ArgumentNullException(nameof(name), "Name must be provided"); LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return SendMessageParallelAsync(message, token); }
/// <summary> /// Queries for specified records. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <returns> All available responses on the local network </returns> public List<LlmnrMessage> Resolve(DomainName name, RecordType recordType = RecordType.A) { if (name == null) throw new ArgumentNullException(nameof(name), "Name must be provided"); LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return SendMessageParallel(message); }
/// <summary> /// Queries for specified records. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <returns> All available responses on the local network </returns> public List<LlmnrMessage> Resolve(string name, RecordType recordType) { if (String.IsNullOrEmpty(name)) { throw new ArgumentException("Name must be provided", "name"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return SendMessageParallel(message); }
/// <summary> /// Queries for specified records asynchronously. /// </summary> /// <param name="name"> Name, that should be queried </param> /// <param name="recordType"> Type the should be queried </param> /// <param name="requestCallback"> /// An <see cref="System.AsyncCallback" /> delegate that references the method to invoked then the operation is complete. /// </param> /// <param name="state"> /// A user-defined object that contains information about the receive operation. This object is passed to the /// <paramref /// name="requestCallback" /> /// delegate when the operation is complete. /// </param> /// <returns> /// An <see cref="System.IAsyncResult" /> IAsyncResult object that references the asynchronous receive. /// </returns> public IAsyncResult BeginResolve(string name, RecordType recordType, AsyncCallback requestCallback, object state) { if (String.IsNullOrEmpty(name)) { throw new ArgumentException("Name must be provided", "name"); } LlmnrMessage message = new LlmnrMessage { IsQuery = true, OperationCode = OperationCode.Query }; message.Questions.Add(new DnsQuestion(name, recordType, RecordClass.INet)); return BeginSendMessageParallel(message, requestCallback, state); }