On 04/15/2014 02:22 PM, Dmitry Yakimenko wrote:
> Thanks. I see in your Python client you're connecting to the daemon
> via socket. The idea behind the C++ implementation that it would
> include the CS code in the binary and would act as a
> daemon/server/client maybe even a tracker in the future. Minimum
> hassle deployment. A bit like Mercurial or Git. Everything in one
> place.
I think we'll want to support both ways. Let's call one the "embedded"
clearskies, and the other the "daemon".
On a desktop, I imagine the typical user would have a clearskies daemon,
controlled by a separate GUI. The GUI wouldn't necessarily always be
running. I'm also going to consider the command-line client to be a UI.
In all these cases, the control protocol would be used.
On mobile, clearskies would be embedded right into the application.
This would use an as-of-yet undocumented C API, let's call it
libclearskies. In this situation the GUI would be running in the same
process space, so there'd be no need to use the control protocol [1].
I propose that we unify things by having the daemon embed clearskies via
the libclearskies API. The control interface should be part of the
daemon, not part of the embeddable libclearskies. Therefore, the
control interface will be using the same API as an embedded client.
That way, we're "dogfooding" the API, which means that it will be a
first-class interface.
That, in turn, should make it easy to create a GUI.
So the control flow for adding a new share on a desktop would look
something like this:
GUI -> Control Socket -> Daemon -> libclearskies -> clearskies_core
Steven
P.S. Whether or not the clearskies-cli interface and the
clearskies-daemon ship inside the same binary or a separate one doesn't
matter to me. I'm just thinking about the internals.