38 Server::Private::Private(DBusServer *s)
43 Server::Private::~Private()
47 void Server::Private::on_new_conn_cb(DBusServer *server, DBusConnection *conn,
void *data)
53 s->
_pvt->connections.push_back(nc);
57 debug_log(
"incoming connection 0x%08x", conn);
63 DBusServer *server = dbus_server_listen(address, e);
65 if (e)
throw Error(e);
67 debug_log(
"server 0x%08x listening on %s", server, address);
69 _pvt =
new Private(server);
71 dbus_server_set_new_connection_function(_pvt->server, Private::on_new_conn_cb,
this, NULL);
84 dbus_server_unref(_pvt->server);
89 debug_log(
"registering stubs for server %p", _pvt->server);
93 dbus_server_set_watch_functions(
95 Dispatcher::Private::on_add_watch,
96 Dispatcher::Private::on_rem_watch,
97 Dispatcher::Private::on_toggle_watch,
102 dbus_server_set_timeout_functions(
104 Dispatcher::Private::on_add_timeout,
105 Dispatcher::Private::on_rem_timeout,
106 Dispatcher::Private::on_toggle_timeout,
111 _pvt->dispatcher = dispatcher;
118 return _pvt->server == s.
_pvt->server;
123 return dbus_server_get_is_connected(_pvt->server);
127 dbus_server_disconnect(_pvt->server);
DXXAPI Dispatcher * default_dispatcher
bool operator==(const Server &) const
virtual void on_new_connection(Connection &c)=0
Dispatcher * setup(Dispatcher *)
Server(const char *address)
DXXAPI LogFunction debug_log
Private(DBusConnection *, Server::Private *=NULL)