示例#1
0
 void slpUser_ServiceFound(object sender, ServiceFoundEventArgs e)
 {
     foreach (UrlEntry url in e.Urls)
     {
         RdmEndPoint controlEndpoint = new RdmEndPoint(new IPEndPoint(e.Address.Address, RdmNetSocket.RdmNetPort), 0)
         {
             Id = UId.ParseUrl(url.Url)
         };
         ControlEndpoints.Add(controlEndpoint);
         DiscoverEndpoints(controlEndpoint);
     }
 }
示例#2
0
 void dnsSD_ServiceAdded(object o, ServiceBrowseEventArgs args)
 {
     args.Service.Resolved += delegate(object sender, ServiceResolvedEventArgs e)
     {
         IResolvableService s = (IResolvableService)e.Service;
         foreach (IPAddress address in s.HostEntry.AddressList)
         {
             RdmEndPoint controlEndpoint = new RdmEndPoint(new IPEndPoint(address, RdmNetSocket.RdmNetPort), 0)
             {
                 Id = UId.ParseUrl(s.TxtRecord["id"].ValueString)
             };
             ControlEndpoints.Add(controlEndpoint);
             DiscoverEndpoints(controlEndpoint);
         }
     };
     args.Service.Resolve();
 }