readme
parent
7678a8ab7a
commit
091d01ef58
|
@ -2,34 +2,27 @@
|
||||||
|
|
||||||
## how things happen
|
## how things happen
|
||||||
|
|
||||||
* Service : daemon providing a feature (windowing, audio, …)
|
* Service: daemon providing a feature (windowing, audio, pubsub, …)
|
||||||
* Application : specific application (browser, instant messaging, …)
|
* Application: specific application (browser, instant messaging, …)
|
||||||
|
|
||||||
* [service] : service name
|
* service: service name
|
||||||
* $pid : application PID
|
* index: process index (to launch a service several times)
|
||||||
* $index : process index (application point of view)
|
* version: service version
|
||||||
|
|
||||||
1. Service creates a pipe named /tmp/[service]
|
1. Service creates a unix socket /tmp/service-index-version.sock
|
||||||
2. Application creates pipes named /tmp/$pid-$index-$version-{in,out}
|
2. Application connects to /tmp/service-index-version.sock
|
||||||
3. Application sends in /tmp/[service] : $pid $index $version
|
|
||||||
|
|
||||||
## pure "networking" view (what should go in the pipes)
|
## pure "networking" view (what should go in the sockets)
|
||||||
|
|
||||||
1. Application sends in /tmp/[service] : $pid $index $version [...]
|
1. Application connects to /tmp/service-index-version.sock
|
||||||
|
1. Service acknowledges (empty message)
|
||||||
|
|
||||||
# messages format
|
# messages format
|
||||||
|
|
||||||
First of all, the application will send a message to the service's pipe in **plain text** with its PID, the number of time the process already used the service (index) and the version of the communication protocol we want to use between the application and the service.
|
In order to communicate between the application and the service, we use the Type-Length-Value format.
|
||||||
|
|
||||||
In order to communicate between the application and the service, we use the [CBOR format (RFC 7049)][cbor].
|
|
||||||
This will be used with some conventions.
|
This will be used with some conventions.
|
||||||
|
|
||||||
## CBOR install, programming, debug
|
## programming, debug
|
||||||
|
|
||||||
[libcbor][libcbor] is used in the provided implementations.
|
|
||||||
It is an [extensively documented][libcbor-doc] library, easy to install and to work with.
|
|
||||||
|
|
||||||
We also strongly encourage the use of the [cbor-diag][cbor-diag] to ensure that you send and receive correctly formatted messages.
|
|
||||||
|
|
||||||
## overview
|
## overview
|
||||||
|
|
||||||
|
@ -41,16 +34,8 @@ The type will be a simple byte :
|
||||||
* <16 - 127> : later use
|
* <16 - 127> : later use
|
||||||
* <128 - 255> : application specific (windowing system, audio system, …)
|
* <128 - 255> : application specific (windowing system, audio system, …)
|
||||||
|
|
||||||
## CBOR type convention
|
|
||||||
|
|
||||||
0 - 15
|
|
||||||
|
|
||||||
index | abbreviation | semantic
|
index | abbreviation | semantic
|
||||||
0 | close | to close the communication between the application and the service
|
0 | close | to close the communication between the application and the service
|
||||||
1 | message | to send data
|
1 | message | to send data
|
||||||
2 | error | to send an error message
|
2 | error | to send an error message
|
||||||
|
3 | ack | to send an acknowledgment
|
||||||
[cbor]: https://tools.ietf.org/html/rfc7049
|
|
||||||
[cbor-diag]: https://github.com/cabo/cbor-diag
|
|
||||||
[libcbor]: https://github.com/PJK/libcbor
|
|
||||||
[libcbor-doc]: https://github.com/PJK/libcbor
|
|
||||||
|
|
Reference in New Issue