Пример #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));
        }
Пример #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));
        }
Пример #3
0
 internal DnsRecord( nsIDNSRecord record )
 {
     _record = new ComPtr<nsIDNSRecord>(record);
 }
 internal DnsRecord(nsIDNSRecord record)
 {
     _record = new ComPtr <nsIDNSRecord>(record);
 }
Пример #5
0
 public void Dispose()
 {
     _record.Rewind();
     _record = null;
     GC.SuppressFinalize(this);
 }
Пример #6
0
 internal DnsRecordEnumerator(nsIDNSRecord record)
 {
     _record = record;
 }
Пример #7
0
 public static DnsRecord Create(nsIDNSRecord record)
 {
     return(record == null ? null : new DnsRecord(record));
 }
Пример #8
0
 private DnsRecord(nsIDNSRecord record)
 {
     _record = new InstanceWrapper <nsIDNSRecord>(record);
 }
 internal DnsRecord(nsIDNSRecord record)
 {
     _record = record;
 }