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

Add Connection.(Un)TrapSignals #22

@hyperair

Description

@hyperair

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 ();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions