X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FClient.cs;h=5734f019903743b1fda1dc6f012dcde40338eaba;hb=9aa4773acbfadbcf95aaf0063510f8be8ddcbd86;hp=73b6f57c0b85f19db23ea3e84c51d027e928a161;hpb=94d2753047cff1e9223e42736884e4d51348b45a;p=catta diff --git a/avahi-sharp/Client.cs b/avahi-sharp/Client.cs index 73b6f57..5734f01 100644 --- a/avahi-sharp/Client.cs +++ b/avahi-sharp/Client.cs @@ -50,12 +50,18 @@ namespace Avahi IPv4 = 0, IPv6 = 1 } - - public enum ClientState { + + internal enum ServerState { Invalid, Registering, Running, - Collision, + Collision + } + + public enum ClientState { + Registering = ServerState.Registering, + Running = ServerState.Running, + Collision = ServerState.Collision, Disconnected = 100 } @@ -232,19 +238,15 @@ namespace Avahi public void Dispose () { - lock (this) { - if (handle != IntPtr.Zero) { - thread.Abort (); - - avahi_client_free (handle); - avahi_simple_poll_quit (spoll); - avahi_simple_poll_free (spoll); - handle = IntPtr.Zero; - } + if (handle != IntPtr.Zero) { + avahi_client_free (handle); + avahi_simple_poll_quit (spoll); + avahi_simple_poll_free (spoll); + handle = IntPtr.Zero; } } - internal void CheckError () + internal void ThrowError () { ErrorCode error = LastError; @@ -270,7 +272,6 @@ namespace Avahi lock (this) { avahi_simple_poll_loop (spoll); } - } catch (ThreadAbortException e) { } catch (Exception e) { Console.Error.WriteLine ("Error in avahi-sharp event loop: " + e); }