summaryrefslogtreecommitdiffstats
path: root/avahi-sharp/RecordBrowser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-sharp/RecordBrowser.cs')
-rw-r--r--avahi-sharp/RecordBrowser.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/avahi-sharp/RecordBrowser.cs b/avahi-sharp/RecordBrowser.cs
index 5a736bd..f65f8ac 100644
--- a/avahi-sharp/RecordBrowser.cs
+++ b/avahi-sharp/RecordBrowser.cs
@@ -23,6 +23,7 @@ using System;
using System.Net;
using System.Collections;
using System.Runtime.InteropServices;
+using System.Text;
namespace Avahi
{
@@ -93,7 +94,7 @@ namespace Avahi
[DllImport ("avahi-client")]
private static extern IntPtr avahi_record_browser_new (IntPtr client, int iface, Protocol proto,
- IntPtr name, ushort clazz, ushort type,
+ byte[] name, ushort clazz, ushort type,
LookupFlags flags, RecordBrowserCallback cb,
IntPtr userdata);
@@ -164,14 +165,13 @@ namespace Avahi
(addListeners.Count == 0 && removeListeners.Count == 0))
return;
- IntPtr namePtr = Utility.StringToPtr (name);
-
lock (client) {
- handle = avahi_record_browser_new (client.Handle, iface, proto, namePtr, (ushort) clazz, (ushort) type,
- flags, cb, IntPtr.Zero);
- }
+ handle = avahi_record_browser_new (client.Handle, iface, proto, Utility.StringToBytes (name),
+ (ushort) clazz, (ushort) type, flags, cb, IntPtr.Zero);
- Utility.Free (namePtr);
+ if (handle == IntPtr.Zero)
+ client.ThrowError ();
+ }
}
private void Stop (bool force)