diff options
author | James Willcox <snopr@snorp.net> | 2005-11-17 21:11:13 +0000 |
---|---|---|
committer | James Willcox <snopr@snorp.net> | 2005-11-17 21:11:13 +0000 |
commit | 9a589e1f5221d1bd995b6c4fa73e3a074d4c2da4 (patch) | |
tree | 10b4bf2a914fa421474e6e895331d3cb4b07c9d9 /avahi-sharp/HostNameResolver.cs | |
parent | 84e07c25895dd6a8f706499a867afa44b9444ce2 (diff) |
* add byte[] overloads for EntryGroup methods
* cleanup string marshalling
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@999 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-sharp/HostNameResolver.cs')
-rw-r--r-- | avahi-sharp/HostNameResolver.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/avahi-sharp/HostNameResolver.cs b/avahi-sharp/HostNameResolver.cs index 0922aa7..81305fd 100644 --- a/avahi-sharp/HostNameResolver.cs +++ b/avahi-sharp/HostNameResolver.cs @@ -23,6 +23,7 @@ using System; using System.Collections; using System.Net; using System.Runtime.InteropServices; +using System.Text; using Mono.Unix; namespace Avahi @@ -51,7 +52,7 @@ namespace Avahi [DllImport ("avahi-client")] private static extern IntPtr avahi_host_name_resolver_new (IntPtr client, int iface, Protocol proto, - IntPtr hostname, Protocol aproto, LookupFlags flags, + byte[] hostname, Protocol aproto, LookupFlags flags, HostNameResolverCallback cb, IntPtr userdata); [DllImport ("avahi-client")] @@ -125,14 +126,14 @@ namespace Avahi (foundListeners.Count == 0 && timeoutListeners.Count == 0)) return; - IntPtr hostPtr = Utility.StringToPtr (hostname); - lock (client) { - handle = avahi_host_name_resolver_new (client.Handle, iface, proto, hostPtr, aproto, flags, + handle = avahi_host_name_resolver_new (client.Handle, iface, proto, + Utility.StringToBytes (hostname), aproto, flags, cb, IntPtr.Zero); + + if (handle == IntPtr.Zero) + client.ThrowError (); } - - Utility.Free (hostPtr); } private void Stop (bool force) |