]> git.meshlink.io Git - catta/commitdiff
oops, forgot some flag bits in ServiceResolver
authorJames Willcox <snopr@snorp.net>
Sun, 25 Sep 2005 22:20:39 +0000 (22:20 +0000)
committerJames Willcox <snopr@snorp.net>
Sun, 25 Sep 2005 22:20:39 +0000 (22:20 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@621 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-sharp/ServiceResolver.cs

index a39299d75ae4551efcebb6c70a78fe261e829610..e94bd13bba53d85d49399c5212778d2729542ac6 100644 (file)
@@ -102,19 +102,21 @@ namespace Avahi
         public ServiceResolver (Client client, string name, string type, string domain) : this (client, -1,
                                                                                                 Protocol.Unspecified,
                                                                                                 name, type, domain,
-                                                                                                Protocol.Unspecified)
+                                                                                                Protocol.Unspecified,
+                                                                                                LookupFlags.None)
         {
         }
 
         public ServiceResolver (Client client, ServiceInfo service) : this (client, service.NetworkInterface,
                                                                             service.Protocol, service.Name,
                                                                             service.ServiceType, service.Domain,
-                                                                            Protocol.Unspecified)
+                                                                            Protocol.Unspecified,
+                                                                            GetLookupFlags (service.Flags))
         {
         }
         
         public ServiceResolver (Client client, int iface, Protocol proto, string name,
-                                string type, string domain, Protocol aproto)
+                                string type, string domain, Protocol aproto, LookupFlags flags)
         {
             this.client = client;
             this.iface = iface;
@@ -123,6 +125,7 @@ namespace Avahi
             this.type = type;
             this.domain = domain;
             this.aproto = aproto;
+            this.flags = flags;
             cb = OnServiceResolverCallback;
         }
 
@@ -209,5 +212,16 @@ namespace Avahi
                     handler (this, new EventArgs ());
             }
         }
+
+        private static LookupFlags GetLookupFlags (LookupResultFlags rflags) {
+            LookupFlags ret = LookupFlags.None;
+
+            if ((rflags & LookupResultFlags.Multicast) > 0)
+                ret |= LookupFlags.UseMulticast;
+            if ((rflags & LookupResultFlags.WideArea) > 0)
+                ret |= LookupFlags.UseWideArea;
+
+            return ret;
+        }
     }
 }