X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FAddressResolver.cs;h=c11e97d751f23be7c6630158a78b7ea979267502;hb=5dd25ac05574bb62b91a591c5728efa60d9dde34;hp=63dc33e74228932a6ae1ac8d88bdebe82cde7911;hpb=84a9392791c574c56ca148157b8b951851208398;p=catta diff --git a/avahi-sharp/AddressResolver.cs b/avahi-sharp/AddressResolver.cs index 63dc33e..c11e97d 100644 --- a/avahi-sharp/AddressResolver.cs +++ b/avahi-sharp/AddressResolver.cs @@ -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); }