Changeset 105
- Timestamp:
- 03/02/07 12:14:20 (1 year ago)
- Files:
-
- dmp/trunk/Mono.Zeroconf/RegisterService.cs (modified) (4 diffs)
- dmp/trunk/Mono.Zeroconf/ServiceBrowser.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmp/trunk/Mono.Zeroconf/RegisterService.cs
r26 r105 45 45 public sealed class RegisterService : Service, IDisposable 46 46 { 47 private Native.DNSServiceRegisterReply regReply; 47 48 private Thread thread; 48 49 private ServiceRef sd_ref; … … 57 58 public RegisterService(string name, string replyDomain, string regtype) : base(name, replyDomain, regtype) 58 59 { 60 regReply = OnRegisterReply; 59 61 } 60 62 … … 105 107 Marshal.Copy(TxtRecord.RawBytes, txt_rec, 0, txt_rec_length); 106 108 } 107 109 108 110 ServiceError error = Native.DNSServiceRegister(out sd_ref, 109 111 auto_rename ? ServiceFlags.None : ServiceFlags.NoAutoRename, InterfaceIndex, 110 112 Name, RegType, ReplyDomain, HostTarget, (ushort)port, txt_rec_length, txt_rec, 111 OnRegisterReply, IntPtr.Zero);113 regReply, IntPtr.Zero); 112 114 113 115 if(error != ServiceError.NoError) { … … 120 122 public void Dispose() 121 123 { 124 GC.KeepAlive(regReply); 125 122 126 if(thread != null) { 123 127 thread.Abort(); dmp/trunk/Mono.Zeroconf/ServiceBrowser.cs
r26 r105 108 108 private void ProcessStart() 109 109 { 110 Native.DNSServiceBrowseReply browseReply = OnBrowseReply; 111 GC.KeepAlive(browseReply); 110 112 ServiceError error = Native.DNSServiceBrowse(out sd_ref, ServiceFlags.Default, 111 interface_index, regtype, domain, OnBrowseReply, IntPtr.Zero);113 interface_index, regtype, domain, browseReply, IntPtr.Zero); 112 114 113 115 if(error != ServiceError.NoError) {
