示例#1
0
 /// <summary> Creates a new instance.
 ///
 /// </summary>
 /// <param name="source">the JmDNS instance which originated the event.
 /// </param>
 /// <param name="type">the type name of the service.
 /// </param>
 /// <param name="name">the instance name of the service.
 /// </param>
 /// <param name="info">the service info record, or null if the service could be be resolved.
 /// </param>
 public ServiceEvent(mDNS source, string type, string name, ServiceInfo info) : base()
 {
     this.source = source;
     this.type   = type;
     this.name   = name;
     this.info   = info;
 }
示例#2
0
		public ServiceInfoResolver(mDNS enclosingInstance, ServiceInfo info)
		{
			InitBlock(enclosingInstance);
			this.info = info;
			info.dns = Enclosing_Instance;
			Enclosing_Instance.AddListener(info, new DNSQuestion(info.QualifiedName, DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
		}
示例#3
0
文件: Responder.cs 项目: pisker/mDNS
		public Responder(mDNS enclosingInstance, DNSIncoming in_Renamed, IPAddress addr, int port)
		{
			InitBlock(enclosingInstance);
			this.in_Renamed = in_Renamed;
			this.addr = addr;
			this.port = port;
		}
示例#4
0
文件: Canceler.cs 项目: pisker/mDNS
		public Canceler(mDNS enclosingInstance, ServiceInfo info, object lock_Renamed)
		{
			InitBlock(enclosingInstance);
			this.infos = new ServiceInfo[]{info};
			this.lock_Renamed = lock_Renamed;
			Enclosing_Instance.AddListener(info, new DNSQuestion(info.QualifiedName, DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
		}
示例#5
0
 public ServiceInfoResolver(mDNS enclosingInstance, ServiceInfo info)
 {
     InitBlock(enclosingInstance);
     this.info = info;
     info.dns  = Enclosing_Instance;
     Enclosing_Instance.AddListener(info, new DNSQuestion(info.QualifiedName, DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
 }
示例#6
0
        /// <summary> Does the necessary actions, when this as a query.</summary>
        internal override bool HandleQuery(mDNS dns, long expirationTime)
        {
            Address dnsAddress = dns.LocalHost.GetDNSAddressRecord(this);

            if (dnsAddress != null)
            {
                if (dnsAddress.SameType(this) && dnsAddress.SameName(this) && (!dnsAddress.SameValue(this)))
                {
                    logger.Debug("handleQuery() Conflicting probe detected. dns state " + dns.State + " lex compare " + lexCompare(dnsAddress));
                    // Tie-breaker test
                    if (dns.State.Probing && lexCompare(dnsAddress) >= 0)
                    {
                        // We lost the tie-break. We have to choose a different name.
                        dns.LocalHost.IncrementHostName();
                        dns.Cache.clear();

                        foreach (ServiceInfo info in dns.services)
                        {
                            info.RevertState();
                        }
                    }
                    dns.RevertState();
                    return(true);
                }
            }
            return(false);
        }
示例#7
0
        /// <summary> Does the necessary actions, when this as a response.</summary>
        internal override bool HandleResponse(mDNS dns)
        {
            Address dnsAddress = dns.LocalHost.GetDNSAddressRecord(this);

            if (dnsAddress != null)
            {
                if (dnsAddress.SameType(this) && dnsAddress.SameName(this) && (!dnsAddress.SameValue(this)))
                {
                    logger.Debug("handleResponse() Denial detected");

                    if (dns.State.Probing)
                    {
                        dns.LocalHost.IncrementHostName();
                        dns.Cache.clear();
                        foreach (ServiceInfo info in dns.services)
                        {
                            info.RevertState();
                        }
                    }
                    dns.RevertState();
                    return(true);
                }
            }
            return(false);
        }
示例#8
0
 public Canceler(mDNS enclosingInstance, ServiceInfo info, object lock_Renamed)
 {
     InitBlock(enclosingInstance);
     this.infos        = new ServiceInfo[] { info };
     this.lock_Renamed = lock_Renamed;
     Enclosing_Instance.AddListener(info, new DNSQuestion(info.QualifiedName, DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
 }
示例#9
0
 public Responder(mDNS enclosingInstance, DNSIncoming in_Renamed, IPAddress addr, int port)
 {
     InitBlock(enclosingInstance);
     this.in_Renamed = in_Renamed;
     this.addr       = addr;
     this.port       = port;
 }
示例#10
0
        // REMIND: Oops, this shouldn't be public!
        /// <summary> JmDNS callback to update a DNS record.</summary>
        public virtual void UpdateRecord(mDNS jmdns, long now, DNSRecord rec)
        {
            if ((rec != null) && !rec.IsExpired(now))
            {
                switch (rec.type)
                {
                case DNSConstants.TYPE_A:
                // IPv4
                case DNSConstants.TYPE_AAAA:                          // IPv6 FIXME [PJYF Oct 14 2004] This has not been tested
                    if (rec.name.Equals(server))
                    {
                        addr = ((Address)rec).IPAddress;
                    }
                    break;

                case DNSConstants.TYPE_SRV:
                    if (rec.name.Equals(QualifiedName))
                    {
                        Service srv = (Service)rec;
                        server   = srv.server;
                        port     = srv.port;
                        weight   = srv.weight;
                        priority = srv.priority;
                        addr     = null;
                        // changed to use getCache() instead - jeffs
                        // updateRecord(jmdns, now, (DNSRecord)jmdns.cache.get(server, TYPE_A, CLASS_IN));
                        UpdateRecord(jmdns, now, (DNSRecord)jmdns.Cache.get_Renamed(server, DNSConstants.TYPE_A, DNSConstants.CLASS_IN));
                    }
                    break;

                case DNSConstants.TYPE_TXT:
                    if (rec.name.Equals(QualifiedName))
                    {
                        Text txt = (Text)rec;
                        text = txt.text;
                    }
                    break;
                }
                // Future Design Pattern
                // This is done, to notify the wait loop in method
                // JmDNS.getServiceInfo(type, name, timeout);
                if (HasData && dns != null)
                {
                    dns.HandleServiceResolved(this);
                    dns = null;
                }
                lock (this)
                {
                    Monitor.PulseAll(this);
                }
            }
        }
示例#11
0
文件: Service.cs 项目: pisker/mDNS
        internal override DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed)
        {
            ServiceInfo info = (ServiceInfo)dns.services[name.ToLower()];

            if (info != null)
            {
                if (this.port == info.port != server.Equals(dns.LocalHost.Name))
                {
                    return(dns.AddAnswer(in_Renamed, addr, port, out_Renamed, new Service(info.QualifiedName, DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN | DNSConstants.CLASS_UNIQUE, DNSConstants.DNS_TTL, info.priority, info.weight, info.port, dns.LocalHost.Name)));
                }
            }
            return(out_Renamed);
        }
示例#12
0
文件: Text.cs 项目: pisker/mDNS
		internal override bool HandleResponse(mDNS dns)
		{
			// Nothing to do (?)
			// Shouldn't we care if we get a conflict at this level?
			/*
				ServiceInfo info = (ServiceInfo) dns.services.get(name.toLowerCase());
				if (info != null) {
				if (! Arrays.equals(text,info.text)) {
				info.revertState();
				return true;
				}
				}*/
			return false;
		}
示例#13
0
文件: Text.cs 项目: rajeshwarn/mDNS
        internal override bool HandleResponse(mDNS dns)
        {
            // Nothing to do (?)
            // Shouldn't we care if we get a conflict at this level?

            /*
             *      ServiceInfo info = (ServiceInfo) dns.services.get(name.toLowerCase());
             *      if (info != null) {
             *      if (! Arrays.equals(text,info.text)) {
             *      info.revertState();
             *      return true;
             *      }
             *      }*/
            return(false);
        }
示例#14
0
 public Renewer(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
     // Associate host to this, if it needs renewal
     if (Enclosing_Instance.State == DNSState.ANNOUNCED)
     {
         Enclosing_Instance.Task = this;
     }
     // Associate services to this, if they need renewal
     lock (Enclosing_Instance)
     {
         foreach (ServiceInfo info in Enclosing_Instance.services.Values)
         {
             if (info.State == DNSState.ANNOUNCED)
             {
                 info.task = this;
             }
         }
     }
 }
示例#15
0
文件: Prober.cs 项目: pisker/mDNS
		public Prober(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
			// Associate the host name to this, if it needs probing
			if (Enclosing_Instance.State == DNSState.PROBING_1)
			{
				Enclosing_Instance.Task = this;
			}
			// Associate services to this, if they need probing
			lock (Enclosing_Instance)
			{
				foreach (ServiceInfo info in Enclosing_Instance.services.Values)
				{
					if (info.State == DNSState.PROBING_1)
					{
						info.task = this;
					}
				}
			}
		}
示例#16
0
 public Prober(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
     // Associate the host name to this, if it needs probing
     if (Enclosing_Instance.State == DNSState.PROBING_1)
     {
         Enclosing_Instance.Task = this;
     }
     // Associate services to this, if they need probing
     lock (Enclosing_Instance)
     {
         foreach (ServiceInfo info in Enclosing_Instance.services.Values)
         {
             if (info.State == DNSState.PROBING_1)
             {
                 info.task = this;
             }
         }
     }
 }
示例#17
0
文件: Announcer.cs 项目: pisker/mDNS
		public Announcer(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
			// Associate host to this, if it needs announcing
			if (Enclosing_Instance.State == DNSState.ANNOUNCING_1)
			{
				Enclosing_Instance.Task = this;
			}
			// Associate services to this, if they need announcing
			lock (Enclosing_Instance)
			{
				foreach (ServiceInfo info in Enclosing_Instance.services.Values)
				{
					if (info.State == DNSState.ANNOUNCING_1)
					{
						info.task = this;
					}
				}
			}
		}
示例#18
0
 public Announcer(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
     // Associate host to this, if it needs announcing
     if (Enclosing_Instance.State == DNSState.ANNOUNCING_1)
     {
         Enclosing_Instance.Task = this;
     }
     // Associate services to this, if they need announcing
     lock (Enclosing_Instance)
     {
         foreach (ServiceInfo info in Enclosing_Instance.services.Values)
         {
             if (info.State == DNSState.ANNOUNCING_1)
             {
                 info.task = this;
             }
         }
     }
 }
示例#19
0
文件: Renewer.cs 项目: pisker/mDNS
		public Renewer(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
			// Associate host to this, if it needs renewal
			if (Enclosing_Instance.State == DNSState.ANNOUNCED)
			{
				Enclosing_Instance.Task = this;
			}
			// Associate services to this, if they need renewal
			lock (Enclosing_Instance)
			{
				foreach (ServiceInfo info in Enclosing_Instance.services.Values)
				{
					if (info.State == DNSState.ANNOUNCED)
					{
						info.task = this;
					}
				}
			}
		}
示例#20
0
文件: Service.cs 项目: pisker/mDNS
        internal override bool HandleResponse(mDNS dns)
        {
            ServiceInfo info = (ServiceInfo)dns.services[name.ToLower()];

            if (info != null && (port != info.port || !server.ToUpper().Equals(dns.LocalHost.Name.ToUpper())))
            {
                logger.Debug("handleResponse() Denial detected");

                if (info.State.Probing)
                {
                    string oldName = info.QualifiedName.ToLower();
                    info.SetName(dns.IncrementName(info.getName()));
                    dns.services.Remove(oldName);
                    dns.services[info.QualifiedName.ToLower()] = info;
                    logger.Debug("handleResponse() New unique name chose:" + info.getName());
                }
                info.RevertState();
                return(true);
            }
            return(false);
        }
示例#21
0
文件: Service.cs 项目: pisker/mDNS
        internal override bool HandleQuery(mDNS dns, long expirationTime)
        {
            ServiceInfo info = (ServiceInfo)dns.services[name.ToLower()];

            if (info != null && (port != info.port || !server.ToUpper().Equals(dns.LocalHost.Name.ToUpper())))
            {
                logger.Debug("handleQuery() Conflicting probe detected");

                // Tie breaker test
                if (info.State.Probing && lexCompare(new Service(info.QualifiedName, DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN | DNSConstants.CLASS_UNIQUE, DNSConstants.DNS_TTL, info.priority, info.weight, info.port, dns.LocalHost.Name)) >= 0)
                {
                    // We lost the tie break
                    string oldName = info.QualifiedName.ToLower();
                    info.SetName(dns.IncrementName(info.getName()));
                    dns.services.Remove(oldName);
                    dns.services[info.QualifiedName.ToLower()] = info;
                    logger.Debug("handleQuery() Lost tie break: new unique name chosen:" + info.getName());
                }
                info.RevertState();
                return(true);
            }
            return(false);
        }
    // Use this for initialization
    async void Start()
    {
#if !UNITY_EDITOR
        // broadcast a service over mDNS / Bonjour / Zeroconfig to avoid having to enter an IP addres
        // arguably this should be the client and the camera should be the server, but I couldn't get it to work that way around for some reason
        LoggingManager.Log("Starting Bonjour");
        mDNS.Logging.LogManager.MessageReceived += LogManager_MessageReceived;
        var service = new mDNS.mDNS(false);
        await service.Init();

        LoggingManager.Log("Initialized Bonjour, broadcasting service");
        service.RegisterService(new mDNS.ServiceInfo("_hololens3._tcp.local.", SystemInfo.deviceName, broadcastPort, "HELLO"));

        // establish command connection
        commandSocket = new StreamSocketListener();
        commandSocket.ConnectionReceived += Server_ConnectionReceived;
        await commandSocket.BindServiceNameAsync(commandPort.ToString());

        // establish video connection
        videoSocket = new StreamSocketListener();
        videoSocket.ConnectionReceived += Server_ConnectionReceived;
        await videoSocket.BindServiceNameAsync(videoPort.ToString());
#endif
    }
示例#23
0
		private void  InitBlock(mDNS enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
		}
示例#24
0
		/// <summary> Creates a new instance.
		/// 
		/// </summary>
		/// <param name="source">the JmDNS instance which originated the event.
		/// </param>
		/// <param name="type">the type name of the service.
		/// </param>
		/// <param name="name">the instance name of the service.
		/// </param>
		/// <param name="info">the service info record, or null if the service could be be resolved.
		/// </param>
		public ServiceEvent(mDNS source, string type, string name, ServiceInfo info):base()
		{
			this.source = source;
			this.type = type;
			this.name = name;
			this.info = info;
		}
示例#25
0
文件: Address.cs 项目: pisker/mDNS
		internal override DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed)
		{
			return out_Renamed;
		}
示例#26
0
文件: Address.cs 项目: pisker/mDNS
		/// <summary> Does the necessary actions, when this as a query.</summary>
		internal override bool HandleQuery(mDNS dns, long expirationTime)
		{
			Address dnsAddress = dns.LocalHost.GetDNSAddressRecord(this);
			if (dnsAddress != null)
			{
				if (dnsAddress.SameType(this) && dnsAddress.SameName(this) && (!dnsAddress.SameValue(this)))
				{
					logger.Debug("handleQuery() Conflicting probe detected. dns state " + dns.State + " lex compare " + lexCompare(dnsAddress));
					// Tie-breaker test
					if (dns.State.Probing && lexCompare(dnsAddress) >= 0)
					{
						// We lost the tie-break. We have to choose a different name.
						dns.LocalHost.IncrementHostName();
						dns.Cache.clear();

						foreach (ServiceInfo info in dns.services)
						{
							info.RevertState();
						}
					}
					dns.RevertState();
					return true;
				}
			}
			return false;
		}
示例#27
0
 public ServiceResolver(mDNS enclosingInstance, string type)
 {
     InitBlock(enclosingInstance);
     this.type = type;
 }
示例#28
0
文件: Service.cs 项目: pisker/mDNS
		internal override bool HandleQuery(mDNS dns, long expirationTime)
		{
			ServiceInfo info = (ServiceInfo) dns.services[name.ToLower()];
			if (info != null && (port != info.port || !server.ToUpper().Equals(dns.LocalHost.Name.ToUpper())))
			{
				logger.Debug("handleQuery() Conflicting probe detected");
					
				// Tie breaker test
				if (info.State.Probing && lexCompare(new Service(info.QualifiedName, DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN | DNSConstants.CLASS_UNIQUE, DNSConstants.DNS_TTL, info.priority, info.weight, info.port, dns.LocalHost.Name)) >= 0)
				{
					// We lost the tie break
					string oldName = info.QualifiedName.ToLower();
					info.SetName(dns.IncrementName(info.getName()));
					dns.services.Remove(oldName);
					dns.services[info.QualifiedName.ToLower()] = info;
					logger.Debug("handleQuery() Lost tie break: new unique name chosen:" + info.getName());
				}
				info.RevertState();
				return true;
			}
			return false;
		}
示例#29
0
 private void  InitBlock(mDNS enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     taskState = DNSState.ANNOUNCING_1;
 }
示例#30
0
文件: DNSRecord.cs 项目: pisker/mDNS
		/// <summary> Adds this as an answer to the provided outgoing datagram.</summary>
		internal abstract DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed);
示例#31
0
 internal override bool HandleResponse(mDNS dns)
 {
     // Nothing to do (?)
     // I think there is no possibility for conflicts for this record type?
     return(false);
 }
示例#32
0
		public RecordReaper(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
示例#33
0
文件: Service.cs 项目: pisker/mDNS
		internal override bool HandleResponse(mDNS dns)
		{
			ServiceInfo info = (ServiceInfo) dns.services[name.ToLower()];
			if (info != null && (port != info.port || !server.ToUpper().Equals(dns.LocalHost.Name.ToUpper())))
			{
				logger.Debug("handleResponse() Denial detected");
					
				if (info.State.Probing)
				{
					string oldName = info.QualifiedName.ToLower();
					info.SetName(dns.IncrementName(info.getName()));
					dns.services.Remove(oldName);
					dns.services[info.QualifiedName.ToLower()] = info;
					logger.Debug("handleResponse() New unique name chose:" + info.getName());
				}
				info.RevertState();
				return true;
			}
			return false;
		}
示例#34
0
文件: Pointer.cs 项目: pisker/mDNS
		internal override bool HandleResponse(mDNS dns)
		{
			// Nothing to do (?)
			// I think there is no possibility for conflicts for this record type?
			return false;
		}
示例#35
0
文件: Pointer.cs 项目: pisker/mDNS
		internal override bool HandleQuery(mDNS dns, long expirationTime)
		{
			// Nothing to do (?)
			// I think there is no possibility for conflicts for this record type?
			return false;
		}
示例#36
0
 /// <summary> Handles a responserepresented by this record.
 ///
 /// </summary>
 /// <returns> Returns true if a conflict with one of the services registered
 /// with JmDNS or with the hostname occured.
 /// </returns>
 internal abstract bool HandleResponse(mDNS dns);
示例#37
0
 /// <summary> Handles a query represented by this record.
 ///
 /// </summary>
 /// <returns> Returns true if a conflict with one of the services registered
 /// with JmDNS or with the hostname occured.
 /// </returns>
 internal abstract bool HandleQuery(mDNS dns, long expirationTime);
示例#38
0
文件: DNSRecord.cs 项目: pisker/mDNS
		/// <summary> Handles a responserepresented by this record.
		/// 
		/// </summary>
		/// <returns> Returns true if a conflict with one of the services registered
		/// with JmDNS or with the hostname occured.
		/// </returns>
		internal abstract bool HandleResponse(mDNS dns);
示例#39
0
 private void  InitBlock(mDNS enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
示例#40
0
文件: DNSRecord.cs 项目: pisker/mDNS
		/// <summary> Handles a query represented by this record.
		/// 
		/// </summary>
		/// <returns> Returns true if a conflict with one of the services registered
		/// with JmDNS or with the hostname occured.
		/// </returns>
		internal abstract bool HandleQuery(mDNS dns, long expirationTime);
示例#41
0
文件: Canceler.cs 项目: pisker/mDNS
		public Canceler(mDNS enclosingInstance, ICollection infos, object lock_Renamed)
		{
			InitBlock(enclosingInstance);
			this.infos = (ServiceInfo[]) SupportClass.ICollectionSupport.ToArray(infos, new ServiceInfo[infos.Count]);
			this.lock_Renamed = lock_Renamed;
		}
示例#42
0
		public TypeResolver(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
示例#43
0
文件: Shutdown.cs 项目: pisker/mDNS
		public Shutdown(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
示例#44
0
 public RecordReaper(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#45
0
文件: Address.cs 项目: pisker/mDNS
		/// <summary> Does the necessary actions, when this as a response.</summary>
		internal override bool HandleResponse(mDNS dns)
		{
			Address dnsAddress = dns.LocalHost.GetDNSAddressRecord(this);
			if (dnsAddress != null)
			{
				if (dnsAddress.SameType(this) && dnsAddress.SameName(this) && (!dnsAddress.SameValue(this)))
				{
					logger.Debug("handleResponse() Denial detected");
						
					if (dns.State.Probing)
					{
						dns.LocalHost.IncrementHostName();
						dns.Cache.clear();
						foreach (ServiceInfo info in dns.services)
						{
							info.RevertState();
						}
					}
					dns.RevertState();
					return true;
				}
			}
			return false;
		}
示例#46
0
 public Shutdown(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#47
0
		// REMIND: Oops, this shouldn't be public!
		/// <summary> JmDNS callback to update a DNS record.</summary>
		public virtual void UpdateRecord(mDNS jmdns, long now, DNSRecord rec)
		{
			if ((rec != null) && !rec.IsExpired(now))
			{
				switch (rec.type)
				{
					
					case DNSConstants.TYPE_A: 
					// IPv4
					case DNSConstants.TYPE_AAAA:  // IPv6 FIXME [PJYF Oct 14 2004] This has not been tested
						if (rec.name.Equals(server))
						{
							addr = ((Address) rec).IPAddress;
						}
						break;
					
					case DNSConstants.TYPE_SRV: 
						if (rec.name.Equals(QualifiedName))
						{
							Service srv = (Service) rec;
							server = srv.server;
							port = srv.port;
							weight = srv.weight;
							priority = srv.priority;
							addr = null;
							// changed to use getCache() instead - jeffs
							// updateRecord(jmdns, now, (DNSRecord)jmdns.cache.get(server, TYPE_A, CLASS_IN));
							UpdateRecord(jmdns, now, (DNSRecord) jmdns.Cache.get_Renamed(server, DNSConstants.TYPE_A, DNSConstants.CLASS_IN));
						}
						break;
					
					case DNSConstants.TYPE_TXT: 
						if (rec.name.Equals(QualifiedName))
						{
							Text txt = (Text) rec;
							text = txt.text;
						}
						break;
					}
				// Future Design Pattern
				// This is done, to notify the wait loop in method
				// JmDNS.getServiceInfo(type, name, timeout);
				if (HasData && dns != null)
				{
					dns.HandleServiceResolved(this);
					dns = null;
				}
				lock (this)
				{
					Monitor.PulseAll(this);
				}
			}
		}
示例#48
0
 public SocketListener(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#49
0
		public SocketListener(mDNS enclosingInstance)
		{
			InitBlock(enclosingInstance);
            
        }
示例#50
0
文件: Prober.cs 项目: pisker/mDNS
		private void  InitBlock(mDNS enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
			taskState = DNSState.PROBING_1;
		}
示例#51
0
 /// <summary> Adds this as an answer to the provided outgoing datagram.</summary>
 internal abstract DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed);
示例#52
0
 public TypeResolver(mDNS enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
示例#53
0
文件: Text.cs 项目: rajeshwarn/mDNS
 internal override bool HandleQuery(mDNS dns, long expirationTime)
 {
     // Nothing to do (?)
     // I think there is no possibility for conflicts for this record type?
     return(false);
 }
示例#54
0
文件: Renewer.cs 项目: pisker/mDNS
		private void  InitBlock(mDNS enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
			taskState = DNSState.ANNOUNCED;
		}
示例#55
0
文件: Text.cs 项目: rajeshwarn/mDNS
 internal override DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed)
 {
     return(out_Renamed);
 }
示例#56
0
 public Canceler(mDNS enclosingInstance, ICollection infos, object lock_Renamed)
 {
     InitBlock(enclosingInstance);
     this.infos        = (ServiceInfo[])SupportClass.ICollectionSupport.ToArray(infos, new ServiceInfo[infos.Count]);
     this.lock_Renamed = lock_Renamed;
 }
示例#57
0
		public ServiceResolver(mDNS enclosingInstance, string type)
		{
			InitBlock(enclosingInstance);
			this.type = type;
		}
示例#58
0
文件: Canceler.cs 项目: pisker/mDNS
		public Canceler(mDNS enclosingInstance, ServiceInfo[] infos, object lock_Renamed)
		{
			InitBlock(enclosingInstance);
			this.infos = infos;
			this.lock_Renamed = lock_Renamed;
		}
示例#59
0
 public Canceler(mDNS enclosingInstance, ServiceInfo[] infos, object lock_Renamed)
 {
     InitBlock(enclosingInstance);
     this.infos        = infos;
     this.lock_Renamed = lock_Renamed;
 }
示例#60
0
文件: Service.cs 项目: pisker/mDNS
		internal override DNSOutgoing AddAnswer(mDNS dns, DNSIncoming in_Renamed, IPAddress addr, int port, DNSOutgoing out_Renamed)
		{
			ServiceInfo info = (ServiceInfo) dns.services[name.ToLower()];
			if (info != null)
			{
				if (this.port == info.port != server.Equals(dns.LocalHost.Name))
				{
					return dns.AddAnswer(in_Renamed, addr, port, out_Renamed, new Service(info.QualifiedName, DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN | DNSConstants.CLASS_UNIQUE, DNSConstants.DNS_TTL, info.priority, info.weight, info.port, dns.LocalHost.Name));
				}
			}
			return out_Renamed;
		}