Example #1
0
        /// <summary>
        /// called to synchronously resolve a hostname.  warning this method may
        /// block the calling thread for a long period of time.  it is extremely
        /// unwise to call this function on the UI thread of an application.
        /// </summary>
        /// <param name="hostName"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public static DnsRecord Resolve(string hostName, ResolveFlags flags)
        {
            if (hostName == null)
            {
                throw new ArgumentException("parameter cannot be null", "hostName");
            }
            nsIDNSRecord record = nsString.Pass(_dnsService.Instance.Resolve, hostName, ( uint )flags);

            return(DnsRecord.Create(record));
        }
Example #2
0
        /// <summary>
        /// called to synchronously resolve a hostname.  warning this method may
        /// block the calling thread for a long period of time.  it is extremely
        /// unwise to call this function on the UI thread of an application.
        /// </summary>
        /// <param name="hostName"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public static DnsRecord Resolve(string hostName, ResolveFlags flags)
        {
            if (hostName == null)
            {
                throw new ArgumentException("parameter cannot be null", "hostName");
            }
            nsIDNSRecord record = null;

            using (nsAUTF8String value = new nsAUTF8String(hostName))
            {
                record = _dnsService.Instance.Resolve(value, (uint)flags);
            }
            return(record == null ? null : new DnsRecord(record));
        }
Example #3
0
 internal DnsRecord( nsIDNSRecord record )
 {
     _record = new ComPtr<nsIDNSRecord>(record);
 }
 internal DnsRecord(nsIDNSRecord record)
 {
     _record = new ComPtr <nsIDNSRecord>(record);
 }
 public void Dispose()
 {
     _record.Rewind();
     _record = null;
     GC.SuppressFinalize(this);
 }
 internal DnsRecordEnumerator(nsIDNSRecord record)
 {
     _record = record;
 }
 public static DnsRecord Create(nsIDNSRecord record)
 {
     return(record == null ? null : new DnsRecord(record));
 }
 private DnsRecord(nsIDNSRecord record)
 {
     _record = new InstanceWrapper <nsIDNSRecord>(record);
 }
 internal DnsRecord(nsIDNSRecord record)
 {
     _record = record;
 }