[avahi] Mono apps don't get notified of ClientState.Running
snorp at snorp.net
Thu May 4 14:17:28 PDT 2006
On Mon, 2006-05-01 at 04:47 +0100, Celso Pinto wrote:
> Hi again guys,
> the Connect() method doesn't work because the Client.OnClientCallback
> method is invoked while avahi_client_new, which means that the Client
> object still has an invalid Handle and Avahi.EntryGroup barfs on it.
> I'm attaching the patch if you care to take a look (it prints a couple
> of debug messages to stdout).
> You'll see that the output "OnClientCallback invoked for state Running"
> is printed before the "Got handle" message.
> Any ideas?
You can just use Client.State to get the initial state, and use the
event callback for later state changes. I know it's not exactly like
the C API, but it works.
Another option is to have use a custom even listener list in Client
(like we do in other places), and when someone connects, emit the
current state -- but I don't really like that.
More information about the avahi