From 94d2753047cff1e9223e42736884e4d51348b45a Mon Sep 17 00:00:00 2001 From: James Willcox Date: Wed, 26 Oct 2005 03:20:44 +0000 Subject: first pass at updating to the 0.6 apis git-svn-id: file:///home/lennart/svn/public/avahi/trunk@876 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-sharp/AddressResolver.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'avahi-sharp/AddressResolver.cs') diff --git a/avahi-sharp/AddressResolver.cs b/avahi-sharp/AddressResolver.cs index 01211ae..3231cbf 100644 --- a/avahi-sharp/AddressResolver.cs +++ b/avahi-sharp/AddressResolver.cs @@ -29,7 +29,7 @@ namespace Avahi { internal delegate void AddressResolverCallback (IntPtr resolver, int iface, Protocol proto, - ResolverEvent revent, Protocol aproto, IntPtr address, + ResolverEvent revent, IntPtr address, IntPtr hostname, LookupResultFlags flags, IntPtr userdata); public delegate void HostAddressHandler (object o, string host, IPAddress address); @@ -124,7 +124,7 @@ namespace Avahi (foundListeners.Count == 0 && timeoutListeners.Count == 0)) return; - IntPtr addrPtr = Utility.StringToPtr (address.ToString ()); + IntPtr addrPtr = Utility.AddressToPtr (address); lock (client) { handle = avahi_address_resolver_new (client.Handle, iface, proto, addrPtr, flags, @@ -147,7 +147,7 @@ namespace Avahi } private void OnAddressResolverCallback (IntPtr resolver, int iface, Protocol proto, - ResolverEvent revent, Protocol aproto, IntPtr address, + ResolverEvent revent, IntPtr address, IntPtr hostname, LookupResultFlags flags, IntPtr userdata) { switch (revent) { @@ -158,15 +158,8 @@ namespace Avahi foreach (HostAddressHandler handler in foundListeners) handler (this, currentHost, currentAddress); break; - case ResolverEvent.Timeout: - currentAddress = null; - currentHost = null; - - foreach (EventHandler handler in timeoutListeners) - handler (this, new EventArgs ()); - break; - default: - EmitResolverEvent (revent); + case ResolverEvent.Failure: + EmitFailure (client.LastError); break; } } -- cgit