Esempio n. 1
0
        private void ProcessDAAdvert(DirectoryAgentAdvertPacket da, IPEndPoint source)
        {
            //We should only register with directory agents that either support our scope or those which support all scopes (the scope list is empty).
            if (da.ScopeList.Count != 0 && !da.ScopeList.Contains(Scope))
            {
                return;
            }

            //Determine if we have previously registered with this DA and if not raise a new DA found event.
            if (!DirectoryAgents.ContainsKey(da.Url))
            {
                //Add this DA to the list of DAs we subscribe to.
                DirectoryAgents[da.Url] = new DirectoryAgentInformation(da.Url, source);;

                //Notify Subscribers that a new DA has been found.
                RaiseNewDirectoryAgentFound();
            }

            //Register with the DA.
            ServiceRegistrationPacket register = new ServiceRegistrationPacket();

            FillHeader(register.Header, da.Header.XId);
            register.Header.Flags |= SlpHeaderFlags.Fresh;
            register.Url           = new UrlEntry(ServiceUrl);
            register.ServiceType   = ServiceType;
            register.ScopeList     = Scope;
            register.AttrList      = AttributeString;

            socket.Send(source, register);
        }
Esempio n. 2
0
        private void ProcessDAAdvert(DirectoryAgentAdvertPacket da, IPEndPoint source)
        {
            if (!DirectoryAgents.ContainsKey(da.Url))
            {
                //Add this DA to the list of DAs we subscribe to.
                DirectoryAgents[da.Url] = new DirectoryAgentInformation(da.Url, source);;

                //Notify Subscribers that a new DA has been found.
                RaiseNewDirectoryAgentFound();
            }

            //Register with the DA.
            ServiceRegistrationPacket register = new ServiceRegistrationPacket();

            FillHeader(register.Header, da.Header.XId);
            register.Header.Flags |= SlpHeaderFlags.Fresh;
            register.Url           = new UrlEntry(ServiceUrl);
            register.ServiceType   = ServiceType;
            register.ScopeList     = Scope;

            socket.Send(source, register);
        }