how can i corrected use dbus without glib
G.t
george-tung at hotmail.com
Tue Sep 8 00:42:21 PDT 2009
Hi,
i want to use dbus+Hal to mount the devices. and i writed some codes,
--------------------code begin-------------------
initialized something.
int fd=-1;
dbus_connection_get_unix_fd(dbus_connection, &fd);
while (m_pTvm->bRun)
{
fd_set rd_fds;
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = 5;
FD_ZERO( &rd_fds );
FD_SET( fd, &rd_fds );
int result=select(fd+1, &rd_fds, NULL, NULL, &timeout);
if(result < 0){
printf("select error\n");
msleep(5);
continue;
}
if (FD_ISSET (fd, &rd_fds)){
printf("----------------------something to
read----------------------\n");
do {
dbus_connection_read_write_dispatch(dbus_connection, -1);
} while (dbus_connection_get_dispatch_status(dbus_connection) ==
DBUS_DISPATCH_DATA_REMAINS);
continue;
}
}
--------------------code end-------------------
the question is i can not receive all the dbus message. then i can not mount
the device.
i'm look forward your advices. thanks.
--
View this message in context: http://www.nabble.com/how-can-i-corrected-use-dbus-without-glib-tp25341278p25341278.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.
More information about the dbus
mailing list