Hi,
finally we have an example implementation for OSYNC_START_TYPE_EXTERNAL.
What this OSYNC_START_TYPE_EXTERNAL about?
This allows to write (standalone) userspace applications which act as OpenSync
plugin. You can use this for example if you try to gather data from an
existing application, which doesn't provides any public interface - e.g. an
extension of an application which communicates with OpenSync.
Currently, there is need of stub plugin, which registers the plugin to the
OpenSync environment. As Graham already suggested in a seperated thread, we'll
very likely change it - so there is only need to write a simple configuration
file to register external plugins.
Additionally we'll add some configuration options so OpenSync can spawn such
external process if they haven't be launced yet. For now such applications
have to be started manually ...
See:
http://opensync.org/browser/trunk/docs/examples/plugins/src/external_demo.c
and
http://opensync.org/changeset/5895
-------8<-------
$ ./example_external_demo ~/.config/opensync/0.40/group6/1/pluginpipe &
[1] 10841
$
[EXTERNAL-DEMO]: OSyncPlugin:0x40159d OSyncClient:0x603040
[EXTERNAL-DEMO]: Starting (blocking) OSyncClient ...
$
$ osynctool --sync external
Synchronizing group "external"
[EXTERNAL-DEMO]: initialize
data sink of member 2 of type file-sync just connected
Main sink of member 2 of type file-sync just connected
data sink of member 1 of type external-demo just connected
Main sink of member 1 of type external-demo just connected
All clients connected or error
[EXTERNAL-DEMO]: get_changes slow_sync: no
data sink of member 2 of type file-sync just sent all changes
data sink of member 1 of type external-demo just sent all changes
Main sink of member 1 of type external-demo just sent all changes
Main sink of member 2 of type file-sync just sent all changes
[...]
The sync was successful
data sink of member 1 of type external-demo just disconnected
Main sink of member 1 of type external-demo just disconnected
data sink of member 2 of type file-sync just disconnected
Main sink of member 2 of type file-sync just disconnected
All clients have disconnected
[EXTERNAL-DEMO]: OSyncClient completed.
[1]+ Done ./example_external_demo ~/.config/opensync/0.40/group6/1/pluginpipe
$
-------->8-----------
This required changes on the OSyncClient API:
osync_client_{get,set}_{plugin,pipe_path} got added to the public API. Which
are used to write an external plugin (see reference implementation).
An public interface which shouldn't be widely used yet got changed:
osync_client_run_and_block() got an additional parameter (OSyncError **) and
changed the return value from void to osync_bool. (Should be very trivial to
port).
If there are any questions regarding this changes, don't hesistate to ask on
the opensync-devel Mailinglist.
Thanks to Henrik and Graham for their feedback and help to get this working!
Best Regards,
Daniel
--
Daniel Gollub Geschaeftsfuehrer: Ralph Dehner
FOSS Developer Unternehmenssitz: Vohburg
B1 Systems GmbH Amtsgericht: Ingolstadt
Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537
EMail: go...@b1... http://www.b1-systems.de
Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D
|