http://bugzilla.moblin.org/show_bug.cgi?id=7711
--- Comment #8 from yongsheng zhu <yongsheng.zhu(a)intel.com> 2010-01-25 23:40:03 PST
---
(In reply to comment #7)
gdbus: add interface-level callback function
Should mention that we want to use this for tracking whether the server is
still in use.
GDBus C++ binding: changes according to gdbus changes
When reading this summary by itself it is not clear what these changes are. The
code itself adds a C-style callback. DBusObjectHelper is meant to be more C++
like. Please use a Boost function object instead of the "void *" + function
pointer. That'll allow you to turn AutoTerm::checkCallback() into a normal
member function in the next patch.
DBus server: automatic termination (MB#7711)
[...]
Allow one dbus client attaching or detaching more than one time. Each
will be treated as only one. Also we detect the client gone without
detaching itself.
This is not clear to me. Does it mean that each attach has to be matched by one
detach, or does "attach + attach + detach" detach the client?
According to the code, it is the latter. I think we should implement the
former, because attach/detach might be called in different, independent modules
of the caller. It would be unexpected if one module was allowed to detach the
whole process. Our documentation is silent on this. Please add a comment there.
Currently attach/detach should be matched. If the number of 'detach' is
bigger
than that of 'attach', the server ignores extra 'detach' operations.
Otherwise,
the server is attached until the client sends enough 'detach' requests or is
gone.
AutoTerm::checkCallback() is not documented. A short comment from
where it is
called would help to understand the code.
+ at->m_elapsed += TERM_INTERVAL;
You assume that checkCallback() will be called in a timely fashion, while in
reality it will be called after TERM_INTERVAL + delta, with delta being large
if the D-Bus server is busy. Therefore m_elapsed will underestimate the real
elapsed time. But because this only happens in a busy server and a busy server
doesn't have to auto-terminate, this code probably really works. A comment
explaining this reasoning would be useful.
+ static GDBusInterfaceFunction getCallback()
Callback? Which callback? ;-) Please choose a better name.
Please put the code into a feature branch mb7711 and remove it from your
personal branch, so that I can merge it more easily.
The code has been moved to
branch mb7711.
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching someone on the CC list of the bug.