This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Description
A TrapSignals and UntrapSignals is needed for the implementation of certain DBus protocols like Avahi, where signals can come in between getting an ObjectPath as the return value of a function call and connecting handlers to its signals. Example use-case, as found in Mono.Zeroconf:
DBusManager.Bus.TrapSignals ();
lock (this) {
if (resolver != null) {
throw new InvalidOperationException ("The service is already running a resolve operation");
}
ObjectPath path = DBusManager.Server.ServiceResolverNew (AvahiInterface, AvahiProtocol,
Name ?? String.Empty, RegType ?? String.Empty, ReplyDomain ?? String.Empty,
AvahiProtocol, LookupFlags.None);
resolver = DBusManager.GetObject<IAvahiServiceResolver> (path);
}
resolver.Failure += OnResolveFailure;
resolver.Found += OnResolveFound;
DBusManager.Bus.UntrapSignals ();