]> git.meshlink.io Git - catta/blobdiff - avahi-sharp/AddressResolver.cs
fix avahi_netlink_new to allow multiple netlinks per process
[catta] / avahi-sharp / AddressResolver.cs
index 63dc33e74228932a6ae1ac8d88bdebe82cde7911..c11e97d751f23be7c6630158a78b7ea979267502 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -55,7 +53,7 @@ namespace Avahi
             this.address = address;
         }
     }
-    
+
     public class AddressResolver : ResolverBase, IDisposable
     {
         private IntPtr handle;
@@ -71,7 +69,7 @@ namespace Avahi
 
         private ArrayList foundListeners = new ArrayList ();
         private ArrayList timeoutListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_address_resolver_new (IntPtr client, int iface, Protocol proto,
                                                                  IntPtr address, LookupFlags flags,
@@ -92,7 +90,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event EventHandler Timeout
         {
             add {
@@ -151,8 +149,11 @@ namespace Avahi
             lock (client) {
                 handle = avahi_address_resolver_new (client.Handle, iface, proto, addrPtr, flags,
                                                      cb, IntPtr.Zero);
+
+                if (handle == IntPtr.Zero)
+                    client.ThrowError ();
             }
-            
+
             Utility.Free (addrPtr);
         }