From ec667b3dfe10945dc6fa140ef5acaaf10a437db9 Mon Sep 17 00:00:00 2001
From: José Bollo
Plugins and features of the binder need to keep track of the client -instances. In principle, a binder afb-daemon is launched by application -instance. But for services, a binder
+instances. This of importance for plugins running as service +because they may have to separate the data of each client. + +For common HTML5 browser running an HTML5 application.
At start, the framework communicate a common secret to both the binder +
At start, the framework communicates a common secret to both the binder and its client: the application. This initial secret is the initial token.
diff --git a/doc/afb-application-writing.md b/doc/afb-application-writing.md index ead31a91..70dde783 100644 --- a/doc/afb-application-writing.md +++ b/doc/afb-application-writing.md @@ -74,12 +74,14 @@ of the client named session. ### Handling sessions Plugins and features of the binder need to keep track of the client -instances. In principle, a binder afb-daemon is launched by application -instance. But for services, a binder +instances. This of importance for plugins running as service +because they may have to separate the data of each client. + +For common HTML5 browser running an HTML5 application. ### Exchanging tokens -At start, the framework communicate a common secret to both the binder +At start, the framework communicates a common secret to both the binder and its client: the application. This initial secret is the initial token. diff --git a/doc/afb-overview.html b/doc/afb-overview.html index 8e03ff10..839d606c 100644 --- a/doc/afb-overview.html +++ b/doc/afb-overview.html @@ -198,6 +198,10 @@ API of its plugins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +For this case, the binder afb-daemon takes care to attribute one single session +context to each client instance. It allows plugins to store and retrieve data +associated to each of its client.
+A specific document shows
+A specific document explains how to write an afb-daemon binder plugin: +HOWTO WRITE a PLUGIN for AFB-DAEMON
Version: 1
+Date: 30 mai 2016
+Author: Manuel Bachmann
+
+
+
+Here are the tests shipped in the source tree:
+ +This clients interactively calls plugins APIs from the command line, using the binder +WebSockets facility.
+ +If afb-daemon has been launched with the following parameters:
+ +$ afb-daemon --port=1234 --token=123456 [...]
+
+
+Then run the client with :
+ +afb-client-demo ws://localhost:1234/api?token=123456 [<api> <verb> [<json-data>]]
+
+
+For instance, to initialize the Audio plugin from the command line :
+ +afb-client-demo ws://localhost:1234/api?token=123456
+
+
+The command doesn’t return. You should type requests of type
auth connect
+audio init
+
+
+If afb-daemon has been launched with the following parameters:
+ +$ afb-daemon --port=1234 --token=123456 [...]
+
+
+and Qt5 is installed.
+ +For installing Qt5 on Ubuntu 16.04:
+ +$ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
+
+
+For installing Qt5 on Fedora 23 :
+ +$ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
+
+
+Then run the client with :
+ +qmlscene test/token-websock.qml
+
+
+and interactively press the buttons, “Connect”, “Refresh”, “Logout”.
+ +If afb-daemon has been launched with the following parameters:
+ +$ afb-daemon --port=1234 --rootdir=$PWD/test [...]
+
+
+(“$PWD/test” being the “test” subdirectory of the source tree)_
+ +Then open your preferred Web browser, connect to the following URL:
+ +http://localhost:1234
+
+
+and interactively run the various tests.
+ + diff --git a/doc/afb-tests-overview.md b/doc/afb-tests-overview.md index a4632d49..4ea25275 100644 --- a/doc/afb-tests-overview.md +++ b/doc/afb-tests-overview.md @@ -1,38 +1,44 @@ # Overview of tests shipped with AFB-Daemon Version: 1 - Date: 30 May 2016 + Date: 30 mai 2016 Author: Manuel Bachmann ## List of tests - Here are the tests shipped in the source tree: - * **afb-client-demo** (command-line WebSockets) - * **token-websock.qml** (Qt/QML WebSockets) - * ***.html** (HTML5/JS HTTP-REST & WebSockets) + +Here are the tests shipped in the source tree: + +* **afb-client-demo** (command-line WebSockets) +* **token-websock.qml** (Qt/QML WebSockets) +* ***.html** (HTML5/JS HTTP-REST & WebSockets) ## Detail of tests ### afb-client-demo (command-line WebSockets) -This clients interactively calls plugins APIs from the command line, using the binder [WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility. +This clients interactively calls plugins APIs from the command line, using the binder +[WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility. If _afb-daemon_ has been launched with the following parameters: -``` -$ afb-daemon --port=1234 --token=123456 [...] -``` + + + $ afb-daemon --port=1234 --token=123456 [...] + Then run the client with : -``` -afb-client-demo ws://localhost:1234/api?token=123456