+ if (StateChanged != null)
+ StateChanged (this, state);
+ }
+
+ private int OnPollCallback (IntPtr ufds, uint nfds, int timeout) {
+ Monitor.Exit (this);
+ int result = poll (ufds, nfds, timeout);
+ Monitor.Enter (this);
+ return result;
+ }
+
+ private void PollLoop () {
+ try {
+ lock (this) {
+ while (true) {
+ if (avahi_simple_poll_iterate (spoll, -1) != 0)
+ break;
+ }
+ }
+ } catch (ThreadAbortException e) {
+ } catch (Exception e) {
+ Console.Error.WriteLine ("Error in avahi-sharp event loop: " + e);
+ }