X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FClient.cs;h=6d39469072947cb6fd0f7ad694be45df239d013d;hb=9541ceb22b5ecd525e16a318b95329a38240a7a4;hp=80349ddb9902b5e925668f1e578cf6de6d1bb41a;hpb=69d2b9fee695cf2e65f1eda9c8ce66085efe2856;p=catta diff --git a/avahi-sharp/Client.cs b/avahi-sharp/Client.cs index 80349dd..6d39469 100644 --- a/avahi-sharp/Client.cs +++ b/avahi-sharp/Client.cs @@ -25,6 +25,9 @@ using System.Threading; using System.Collections; using System.Runtime.InteropServices; using Mono.Unix; +using Mono.Unix.Native; + +using Stdlib = Mono.Unix.Native.Stdlib; namespace Avahi { @@ -49,15 +52,22 @@ namespace Avahi public class ClientStateArgs : EventArgs { private ClientState state; + private ErrorCode error; public ClientState State { get { return state; } } - public ClientStateArgs (ClientState state) + public ErrorCode Error + { + get { return error; } + } + + public ClientStateArgs (ClientState state, ErrorCode error) { this.state = state; + this.error = error; } } @@ -86,7 +96,8 @@ namespace Avahi public enum LookupFlags { None = 0, UseWideArea = 1, - UseMulticast = 4, + UseMulticast = 2, + NoTxt = 4, NoAddress = 8 } @@ -345,7 +356,7 @@ namespace Avahi private void OnClientCallback (IntPtr client, ClientState state, IntPtr userData) { if (StateChanged != null) - StateChanged (this, new ClientStateArgs (state)); + StateChanged (this, new ClientStateArgs (state, LastError)); } private int OnPollCallback (IntPtr ufds, uint nfds, int timeout) {