public Client(ClientFlags flags)
{
spoll = avahi_simple_poll_new ();
pollcb = OnPollCallback;
avahi_simple_poll_set_func (spoll, pollcb);
IntPtr poll = avahi_simple_poll_get (spoll);
cb = OnClientCallback;
int error;
handle = avahi_client_new (poll, flags, cb, IntPtr.Zero, out error);
if (error != 0)
throw new ClientException (error);
thread = new Thread (PollLoop);
thread.IsBackground = true;
thread.Start ();
}